Re: Keyboard wonkiness...



almafeta@xxxxxxxxx wrote:
So, I have two machines that I code on. One's a laptop, one's a
desktop. For the most part, they work identically, and they've done
all my demos correctly.
....

But now, I come across a strange bit of nonunity: keycodes. I can
read the codes fine, but it seems the codes for non-alphabetic keys
aren't guaranteed to be the same across keyboards.

You must access the input stream at a level higher than keycodes.

You would have to do this anyway, or users of differently-arranged
keyboards (finnish or german, etc) won't be able to play your game.

So read your system documentation. I can't help you on Windows, but
Linux gives you a choice of several levels: You can twiddle IOCTLs
all by your lonesome and write your own custom keyboard driver (which
a number of arcade-style games do - see the example project
"kasteroids" source code to see how that works), or you can read raw
scancodes (assuming you're not reading them from an Xwindows app,
'cause Xwindows is jealous that way) or you can read "virtual"
scancodes which are supposed to be corrected for keyboard hardware
differences, or you can read "characters", which are corrected for
different international keyboard layouts.

I seriously recommend the use of the "curses" library (available
on Windows as pdcurses) and its functionality for reading at the
character level.

If you read anything below the level of "characters" or ncurses/pdcurses
keystroke identifiers, then your game is not likely to be portable
across even minor national-keyboard layout differences. If you read
anything below the level of virtual scancodes, your game will not be
portable across differences in hardware (as you're discovering).

.



Relevant Pages

  • Re: Games for July - Cruise for a Corpse
    ... Codes and so on? ... a well constructed adventure game. ... the game) and use them with all characters and locations. ... trigger in order to progress in the game. ...
    (comp.sys.amiga.games)
  • >>>> KEYBOARD GAMES <<<<
    ... playstation 2 games keyboard support, keyboard music percussion online ... game, typing keyboard game online, keyboard controller emulator for pc ... game keyboard and mouse emulater, game controller keyboard, sexy beach ...
    (talk.religion.misc)
  • Re: Determinism
    ... The Microsoft ergonomic keyboard feels ok. ... coordination, dexterity and tremors have advanced this year. ... Have you tried the game, ... Or if you want a real-time game that is an exercise in coordination, ...
    (talk.origins)
  • Re: Determinism
    ... matching numbers A-Z to numbers 1-26. ... Or if you aren't using the keyboard intensively, ... for a separate tablet and screen to be more difficult. ... Have you tried the game, ...
    (talk.origins)
  • RE: SendKeys.Send Problem
    ... I've read your following comments and wrote some codes. ... I am not familiar with the german keyboard, so it is hard for me say the ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading