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

Author Topic: Key event issue on Linux?  (Read 3523 times)

0 Members and 1 Guest are viewing this topic.

sparklehorse

  • Newbie
  • *
  • Posts: 5
    • View Profile
Key event issue on Linux?
« on: February 14, 2010, 06:51:24 pm »
Hi,

I was wondering if there is a known issue with certain key events (or rather key codes) on Linux.

I'm using SFML 1.5 on Ubuntu (9.10),  and while SFML reports all key pressed/releases correctly, the Code member is sometimes unset (i.e. 0) for keys that I would expect to work (for example the tilde key, or the caps lock key).

Interestingly enough, the text event that follows the key event always generates the correct unicode symbol for the pressed key.

Best regards,

  Matthias

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Key event issue on Linux?
« Reply #1 on: February 14, 2010, 07:32:04 pm »
Yes, I need to write a more complete handling for key codes, some keys are not recognized with some keyboard configurations (this task already exists in the task list, by the way).
Laurent Gomila - SFML developer

Daniel Benoy

  • Newbie
  • *
  • Posts: 2
    • View Profile
Key event issue on Linux?
« Reply #2 on: July 11, 2010, 08:39:05 pm »
Is there a workaround available?  I'm trying to make a chat game, and not being able to type:

:)

would be a problem...

In fact, it would be nice if this engine supported unicode, in case I get any international players.

Daniel Benoy

  • Newbie
  • *
  • Posts: 2
    • View Profile
Key event issue on Linux?
« Reply #3 on: July 11, 2010, 08:40:11 pm »
This forum decided to be clever, and replaced what I typed with an image.  It was a colon, and then a close parenthesis.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Key event issue on Linux?
« Reply #4 on: July 12, 2010, 08:16:29 am »
For text you should use the TextEntered event, not the KeyPressed one. The former always gives you the unicode character that you typed, no matter what keyboard configuration you have.
Laurent Gomila - SFML developer

 

anything