int bx_keycode_pressed ( bx_key  key,
unsigned char  keycode 
)

Checks if a key known by its keycode is pressed in a given keyboard snapshot. The keycode is a number given to key depending on its physical location on the keyboard.

Parameters:
key a snapshot of the keyboard returned by bx_read_key().
keycode a keycode describing the physical location of a key.
Returns:
whether the key is pressed (= 1) or released (= 0).
Remarks:
  • see also bx_keynames() for a list of the names of all pressed keys.
  • if keys named "Shift" and "x" are pressed, then they are both reported as such individually, but keep in mind there is no such key named as "X" for example.
  • You use bx_keycode_pressed() instead of bx_keyname_pressed() when you want to know if this key located in the region of the top-left corner of the keyboard is pressed, whatever keyname is mapped onto it (such as a "a" on AZERTY mappings, or a "q" for QWERTY mappings, etc...).
  • For example, on AZERTY mappings, key named "Q", "S", "D", and "Z" are physically located in a way that make them easy to use them as arrows (left, down, right and up) in a game. This is not the case on QWERTY mappings, so for such a use, you may want to use bx_keycode_pressed() instead of bx_keyname_pressed().


Generated on Fri Oct 10 00:01:00 2008 for bx-lib : the Basic X11 Library tuned for C beginners by  doxygen 1.5.6