KeyString for mouse keys

lucasw89 Posts: 5
Hey, I am doing some changing of keybinds with pyxel, but cant figure out what keystring a mouse button have. Here I am thinking of mouse button 4 / 5. Any and all help appreciated. Thanks for reading, have a nice day.

Comments

  • CandyFaceCandyFace Posts: 534
    Hi lucasw89

    No I'm afraid that not possible. Air or more specifically ActionScript 3 only exposes three buttons for the mouse, CLICK, RIGHT_CLICK and MIDDLE_CLICK.

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/MouseEvent.html

    button 4,5 doesn't exist natively in windows, they're special functions made available by your mouse driver.
  • lucasw89 Posts: 5
    That's all OK. But would you happen to know if i can use a combination like ctrl + alt + scroll wheel to do this?
  • CandyFaceCandyFace Posts: 534
    edited May 19
    I think you can access the keys for scroll wheel with 
    MIDDLE_MOUSE_DOWN and MIDDLE_MOUSE_UP. 

    You can find all the possible actions to bind in the readme.txt file located in the same folder as keybindings.json

    If you want to use ctrl, alt or shift, then set "shiftKey, ctrlKey and altKey to true.
  • lucasw89 Posts: 5
    Sorry to bother you once again, but I just can't get this to work.
    I tried doing this:
    [
      {
        "action": "increase_brush_size_action",
        "keyString": "MIDDLE_MOUSE_UP",
        "altKey": false,
        "ctrlKey": true
      },
      {
        "action": "decrease_brush_size_action",
        "keyString": "MIDDLE_MOUSE_DOWN",
        "altKey": false,
        "ctrlKey": true
      }
    ]

    With the intent to increase and decrease the brush size, if i hold control and scroll up / down, though nothing happens >.<

    Its probably just me being stupid though. Thanks for your time! 
  • CandyFaceCandyFace Posts: 534
    That's weird, it work for me, although i'm using the trackpad on my laptop to simulate the mouse wheel buttons, it should be same. Did you have PyxelEdit closed when you saved the changes?


    Also, just to make sure, you're editing the keybindings.json file from here right?
    Windows: C:\Users\[username]\AppData\Roaming\PyxelEdit or similar.
    You can enter %appdata% as the path in windows explorer to find the Roaming folder quickly.

    Mac: /Users/[username]/Library/Application Support/PyxelEdit or similar.
  • lucasw89 Posts: 5
    Sorry for the extreme delay, it has been a very busy weekend for me.
    Yes indeed. It seems that pyxel accepts the changes. I can it created brackets ([ and ]) if i delete them, so it must be accepting the changes.

  • lucasw89 Posts: 5
    This is very weird, but I got something working. Its just that its the wrong keys?

    Holding down shift + mouseweel does the trick, and that works fine for me. Thanks for the help, and may you have the best life you can!
  • CandyFaceCandyFace Posts: 534
    So you did you get it working then?
Sign In or Register to comment.