I've been playing with gosu and chingu and I can't figure out how to do something when a user hits the semicolon or quote keys. I see you can check if the key pressed was the left arrow with Gosu::KbLeft, but where can I view for all the other key mappings?
The window has a method called button_down(id) and button_up(id) I believe. You can check what key is being pressed according to the id being passed.
To find out the id of the key pressed, just print id. That way you'll find out the key code for the semicolon, and then in the future you can check if the semicolon is being pressed or not.
Note that, it seems that between Windows and Mac, the key codes are different.
Yes, if you want to use punctuation keys you'll need to have some way for users to configure the keys themselves if you want it to work cross-platform.
There is no semicolon key on German keyboards, that's why it's missing. I think it is either of ÄÖÜ here. I should add it though, in the spirit of the KbZ id (that is a 'Y' on German keyboards). Patches welcome. :)
chingu has a nice key-detector application
in the examples folder. Easiest way to get Gosu and/or Chingu key codes (Gosu uses not terribly friendly constants; Chingu uses nicer symbols).
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill