jigish / slate

A window management application (replacement for Divvy/SizeUp/ShiftIt)
GNU General Public License v3.0
7.85k stars 510 forks source link

Binding to “y” key doesn't work #198

Open hansmi opened 11 years ago

hansmi commented 11 years ago

Irrespective of the modifiers I use, binding to the “y” key doesn't appear to work.

Example configuration:

bind y:ctrl;alt corner bottom-left
bind x:ctrl;alt corner bottom-right

If I press Control-Option-x, the active window moves to the bottom right as expected. If I press Control-Option-y, nothing happens. I ran a local build from Xcode and saw the hotkey being registered, but it still wouldn't work and no log messages were generated upon pressing Control-Option-y.

I'm using Mac OS X 10.8.2 with a Swiss German keyboard layout.

jigish commented 11 years ago

@hansmi can you do me a favor and use http://manytricks.com/keycodes/ to tell me what the key code for your y key is? Also, if you could send me the output of the logs that would be great.

hansmi commented 11 years ago

Thanks for your reply, Jigish. Turns out the key codes for “x” and “y” are swapped in the Swiss German layout (from Events.h: kVK_ANSI_Y = 0x10, kVK_ANSI_Z = 0x7). If I bind to both keys, the actions are swapped too.

Thinking about it now it's obvious why: the German keyboard layouts (Germany, Austria and Switzerland), as well as others, are QWERTZ, not QWERTY. Could you add a “keyboardLayout” value for it? I'll be happy to provide further information or to test patches.

Key Down
Characters: y
Unicode: 121 / 0x79
Keys: Y
Key Code: 6 / 0x6
Modifiers: 256 / 0x100

Key Down
Characters: z
Unicode: 122 / 0x7a
Keys: Z
Key Code: 16 / 0x10