Keyboard, etc...

Ryan C. Gordon icculus at
Tue Jan 1 05:55:32 EST 2002

1) The URL in README.r is listed as, but it is really  ...granted, everyone's probably hitting Relnev's
homepage anyhow, but it's best to be accurate, in case you plan to really
move the project to its own webspace. (and, hey, we might want to
overthrow QuakeForge on the first game sometime, also.  :)  )

2) in quake2/src/linux/rw_sdl.c:
   /* suggestions on how to handle this better would be appreciated */
      case SDLK_WORLD_7:   key = '`'; break;

...SDL_EnableUNICODE(), and check event.key.keysym.unicode for '`' or '~'.
(or maybe just '~'.) Not sure if this is a perfect solution, or the
ramifications for international keyboards, which brings us to...

3) What to do with the SDLK_WORLD* keys. Here's my thought:

  All those defines should become an enum, in my opinion, with the last
element being K_TOTAL (if nothing else, #define K_TOTAL should be added,
but the enum takes care of the math if arbitrary keys get added later
(including the ones we'll add...).

  extern char keybindings[256] should become extern char
keybindings[K_TOTAL]. Same goes for keyrepeats right below it. (If I'm
guessing those things' purposes correctly).

  Add K_WORLD* equivalents, and then fill them into the SDL driver
accordingly. Other drivers can go on as usual, since NOT returning WORLD
key input is always a possibility.

  Add them to the keynames array in keys.c, too. "WORLDxx" will probably

  I assume the console can only take 8-bit ASCII chars, so we might need
to throw away keys that are > 255 in value for that, or have a default
character (like a square or something). This depends also on how many
chars are available in the font the console has.

As you can see, I've done jack for research, but this will get you most of
the way there. Thoughts and comments welcome.


More information about the quake2 mailing list