SFML community forums

Help => System => Topic started by: Celtic Minstrel on November 16, 2013, 12:44:15 am

Title: Incorrect key mapping? (OSX)
Post by: Celtic Minstrel on November 16, 2013, 12:44:15 am
I just noticed that when I press the (-/_) key (between 0 and +/=) on my Apple keyboard, it's reported by keypress events as Keyboard::Menu instead of Keyboard::Dash. I'm on MacOSX (10.7), and I compiled the libraries myself using CMake. Does this happen for anyone else?

EDIT: More detail! The key event says it's KEY_MENU and in addition that it has all four modifier keys pressed, when in fact none were pressed; also, no TextEntered event seems to be generated. Pressing it with a modifier key seems not to trigger any keypress event, though with shift or option a TextEntered event is generated.

EDIT 2: On closer inspection, it looks like there's no KeyPressed event at all and the event is simply a TextEntered event. So, the TextEntered is generated, but the KeyPressed is not. This is contrary to the behaviour of (for example) alphabetic keys, which generate both a KeyPress and a TextEntered.

EDIT 3: This prompted me to try all keys to see what they're reported as, and I discovered that pressing tilde generates Keyboard::Dash instead of Keyboard::Tilde! However, if a modifier key is held while pressing tilde, no keypress seems to be reported. There were other things as well that I noticed, but they're probably not as important.

EDIT 4: Not quite related, but I can't catch Command-Period. When I press it I just hear the system alert sound and my program doesn't get an event. This could be related to Command-Period being a common "interrupt" sequence? I'm not sure.
Title: Re: Incorrect key mapping? (OSX)
Post by: eXpl0it3r on November 16, 2013, 01:43:49 am
SFML's key handling isn't the best, that's why issue #7 (https://github.com/SFML/SFML/issues/7) exists. Then again you already know that issue given your post there. ;)

I guess we'll need someone that spends on research what the best way is.
Title: Re: Incorrect key mapping? (OSX)
Post by: Celtic Minstrel on November 16, 2013, 01:54:10 am
Oh yeah, I forgot numpad equals and decimal are indistinguishable from their non-numpad counterparts... this is still the case as well.

But most of that is about missing keys, not downright incorrect keys. Still, I guess I'll repost this on that thread, then.

EDIT: Looks like someone already reported the hyphen issue. Ah well.