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

Author Topic: sf::Key::Code::lastKey  (Read 26240 times)

0 Members and 1 Guest are viewing this topic.

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
sf::Key::Code::lastKey
« on: October 10, 2007, 01:25:56 pm »
For passing arrays with all currently pressed keys, it would be nice to have an official sf::Key::Code::lastKey, as Count is marked as internal. (I need this to make inputbridges, which swap/move/overwrite several keys, to make splitscreen programming easier)

Maybe it's enough to label Count as external and announce that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::Key::Code::lastKey
« Reply #1 on: October 10, 2007, 02:34:39 pm »
Hum, ok, I can do this of course ;)
Laurent Gomila - SFML developer

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
sf::Key::Code::lastKey
« Reply #2 on: October 13, 2007, 12:06:39 pm »
Am I just blind or is the Print key missing?
I dont quite understand how you decided to take this keyboard enumerators and not others...maybe it's related to the freaking keyboardmapping of french keyboards:)
When I went there some years ago and tried to write a mail I ended up with a lot of random unreadable crap...but, what would be interesting is, if I want o access the 'ä' key, as I'm in germany, and you want to access some ' or what ever you got instead there, how can I do this?
Is it safe to test the keycode as integer from the event(if it's fired, didnt test it yet) or is it atm impossible to use these special keys?
greatings, good job anyway:)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::Key::Code::lastKey
« Reply #3 on: October 13, 2007, 01:10:40 pm »
Quote
Am I just blind or is the Print key missing?

No, it's really missing. If I remember correctly, I didn't add it because I couldn't find it in the X11 (Linux) API.

Quote
I dont quite understand how you decided to take this keyboard enumerators and not others...maybe it's related to the freaking keyboardmapping of french keyboards:)

Probably :D
If it's really freaking, I'm opened to any suggestion to make it more english-friendly.

Quote
When I went there some years ago and tried to write a mail I ended up with a lot of random unreadable crap...but, what would be interesting is, if I want o access the 'ä' key, as I'm in germany, and you want to access some ' or what ever you got instead there, how can I do this?
Is it safe to test the keycode as integer from the event(if it's fired, didnt test it yet) or is it atm impossible to use these special keys?

For more specific characters, you should use the TextEntered event, which uses unicode and is able to report you any character entered, even those î or ä resulting from a combination of several keys.
Laurent Gomila - SFML developer

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
sf::Key::Code::lastKey
« Reply #4 on: October 13, 2007, 01:29:22 pm »
Quote from: "Laurent"
Quote
Am I just blind or is the Print key missing?

No, it's really missing. If I remember correctly, I didn't add it because I couldn't find it in the X11 (Linux) API.

Maybe I'll do a search on this and report on success:)

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
sf::Key::Code::lastKey
« Reply #5 on: October 13, 2007, 02:33:59 pm »
I dont know, how it works for your Mac or Win implementations, but at least for windows it should be easy. For Linux you have to add to WindowImplX11.cpp after line 900:
Code: [Select]

case XK_Print :       return Key::Print;


And of course you have to add Key::Print and Windows/Mac implementation.

have fun:)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::Key::Code::lastKey
« Reply #6 on: October 13, 2007, 05:37:13 pm »
I think I already tried XK_Print, and it was not reacting to my Print key.
But anyway, I'll be able to do more tests when I have my computer.
Laurent Gomila - SFML developer