Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Incorrect key mapping? (OSX)  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

Celtic Minstrel

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Incorrect key mapping? (OSX)
« 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.
« Last Edit: November 16, 2013, 01:19:52 am by Celtic Minstrel »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Incorrect key mapping? (OSX)
« Reply #1 on: November 16, 2013, 01:43:49 am »
SFML's key handling isn't the best, that's why issue #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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Celtic Minstrel

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Incorrect key mapping? (OSX)
« Reply #2 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.
« Last Edit: November 16, 2013, 01:59:02 am by Celtic Minstrel »

 

anything