RE: [GD-General] Key handling revisited
Brought to you by:
vexxed72
From: Jamie F. <ja...@qu...> - 2002-02-11 10:36:33
|
I'm also interested in a related issue: if anyone has a sensible input model that can work across computers and consoles, i'd love to hear it :) at the moment the plan is to reimplement the control interface on each platform (it'll need tweaking for each platform anyway), but i don't want to have to do more work than is necessary on a problem that _surely_ must have been solved? :) Jamie -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Brian Hook Sent: 10 February 2002 02:39 To: gam...@li... Subject: [GD-General] Key handling revisited After thinking about my key handling situation for a day, I think I finally stumbled upon the obvious solution. Fundamentally I wasn't differentiating between ASCII characters and raw key codes, so I ended up just having a jumble of logic both on the key reading side (my platform driver) and on the application side. My HEvent structure only had a keyCode member, which mapped to my system virtual key constants (directly taken from the VK_ constants in WINUSER.H so that there was a one-to-one mapping). To simplify my life, I just added another field, evChar, which is the ASCII representation of the virtual key code. So I can differentiate between top row "0", keypad "0", or just read an ASCII "0" depending on the needs of the calling routine. Yeah, kinda duh, but for some reason I was just focused on having a single key code and doing the appropriate thing with it at all times. Of course, this doesn't address the issue of international keyboards. I have no idea what to do about that, other than just hope and pray it's not a problem. And if it is, I guess I'll deal with it then. Brian _______________________________________________ Gamedevlists-general mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=557 |