True, there's really no point to use the enum numbers directly.
You bring up a good point about split screen. I hadn't considered the possibility of people wanting to play split screen on a computer, as I generally see that as a console feature. Cobalt is the first game I can think of which is a PC game that has split-screen multiplayer.
By jlnr (dev)
Date 2012-01-01 03:31
Edited 2012-01-01 03:55
Well, something is wrong with Gosu already then. There is no portable way to save players' keyboard configuration short of storing those magic numbers in a file right now. :( You could look them up based on constant names, especially in Ruby, but that doesn't help if the player binds actions to unnamed keys.
Using names with a fallback on numbers, and maybe even storing id_to_char
along with it, would be the safest solution. I think Gosu should provide this, actually. It could also store the USB device identifier later if multiple gamepads are ever supported.
I save the Chingu input names, which are symbols that reference the gosu constants, so that is fine. But yeah, you could do with something like that in Gosu itself.
How is it possible to bind actions to unnamed keys? At least on Linux, when I press a key for which there is no constant, I do not get any ID in #button_down(). Should the ability to bind unnamed keys even exist in Gosu?
By jlnr (dev)
Date 2012-01-08 08:02
Yes, sure. I think Gosu is even missing names for some really basic keys that I didn't know how to name, like [] (the öäü+# area on a German keyboard). If you do not get the ID, then this is a bug actually- feel free to file it. (It may be related to Gosu translating keys to characters too early on Linux.)
KbÖ appears to be a valid identifier in Ruby 1.9.3. C:
By jlnr (dev)
Date 2012-01-10 18:40
Maybe we can also find a safe character resembling '[' somewhere in Unicode :)
Now you're just being silly. :D