Closed samueller closed 12 years ago
Chingu can only listen to the same keypresses Gosu can. I can't find semicolon or quotes here http://www.libgosu.org/rdoc/Gosu.html .. can I ask what you want them too? Seems like odd keys to use for in game control. I'm pretty sure they'll display using Gosus textinput thingie though.. but that's for freetext input like highscore-names and similar.
I have a game with 2 players at one keyboard (a player using the left side and a player using the right side) to control their characters. I need to make use of keys next to the enter key as much as possible to make it comfortable for the players.
But I can also imagine a game with so many controls that you run out of the letters to easily play the game...
I played around a little with these keys that aren't documented by Gosu, the problem is they are completely different values for Windows vs Mac. I think for Linux this is the case too... not that big of a problem I guess, but a pain.. And I need to figure out how to determine whether the computer is a mac, windows or pc after getting the values of the keys I want. Something I would totally expect the game framework to handle for me.
Couldn't a 2-player game use WASD for player #1 and the arrow-keys for player #2? Or move player #2 even further to the right by using the numpad with Numlock pressed. Maybe you need a lot more keys for your controls.
In either case, if you find undocumented Gosu keyconstants it should be very easy to add them here: https://github.com/ippa/chingu/blob/master/lib/chingu/input.rb .. the code explains itself. I'm on win 7 so I'm not sure what keys differ between mac, linux and windows.
I agree that this is something the framework should handle.. but if Gosu doesn't handle it Chingu can't since it's built upon Gosu.
Gosu is missing a lot of key constants. They're aware of it and asked for patches... If I get time I'll help.
I see that chingu maps gosu's keys to nice simple symbols. But there doesn't seem to be a symbol for the semicolon or quote characters (or others I'm sure). I don't know what they would map to for gosu or if gosu takes into account those characters either.
What can I do to listen to semicolon and quote keypresses?