Closed Zardoz89 closed 11 years ago
May be these key are send on "text enter event" another solution is use these event only for theses special cases and send pressed and released event to the keyboard
if (event.type == sf::Event::TextEntered) { if (event.text.unicode == '!' || event.text.unicode == '@'|| event.text.unicode=='|') { keyboard.handlekey(true,event.text.unicode); keyboard.handlekey(false,event.text.unicode); }
}
I thought that Event::TextEntered returned a text string, not individual characters. I'm testing it in a small test program to see how works.
OK, works pretty fine. The only problem is that the generic keyboard will push a Shift pressed /released after and before.
Updated: Implemented
For what I researched, SFML can't handle some key events, like ! " | @ (Alt gr+number or Shift + number). It isn't a bug, they simple ignored these cases and return a "Unknow key" (-1) value. I send a Issue but looks that is pretty old (first issue two years ago!).
I think that We have this options.
What do you think that should try ?