Pyxel Edit Forum Archive
ArchiveQuestions

KeyString for mouse keys

L
lucasw89
May 18, 2017 at 8:40 pm
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.
CandyFace
May 18, 2017 at 11:07 pm
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.
L
lucasw89
May 19, 2017 at 4:19 pm
That's all OK. But would you happen to know if i can use a combination like ctrl + alt + scroll wheel to do this?
CandyFace
May 19, 2017 at 5:04 pm
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.
L
lucasw89
May 19, 2017 at 9:51 pm
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! 
CandyFace
May 20, 2017 at 7:40 am
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.
L
lucasw89
May 23, 2017 at 7:51 pm
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.

L
lucasw89
May 23, 2017 at 7:53 pm
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!
CandyFace
May 23, 2017 at 7:54 pm
So you did you get it working then?