key events for action game




Hello,

I started writing an action game (with Gtk/Gdk 1.2) and I can't figure out
the correct way to get keyboard input. The actions should be proportional
to the time the arrow keys have been down (it is a scrolling/shooting game
like Tyrian or Zanac 2).

I tried to do it getting the key_press and key_release events and
accomplishing actions according to the number of events caught, but
this the keys that are down cease to generate events when another key is
pressed down (e.g.: I'm moving the ship and start firing. The ship
stops moving because of the fire key (space) ).

I'd like to receive advice on this and would be happy if anyone could
point some game sources that do this well with Gtk/Gdk.

(and before someone sends me something funny about it: I don't want to
use any Clanlib-like libraries. Unless stated impossible, I wish to keep
it over gtk/gdk)

-- Felipe



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]