Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

KeyDownEvent Struct Reference

Information about key presses. More...

#include <system.h>

List of all members.

Public Attributes

ulong controlKeyState
ushort keyCode
CharScanType charScan

Detailed Description

This structure stores information about key presses.

The KeyDownEvent structure is a union of keyCode (a ushort) and charScan (of type struct CharScanType). These two members represent two ways of viewing the same data: either as a scan code or as a key code.

Scan codes are what your program receives from the keyboard, while key codes are usually needed in a switch statement.

See file `tkeys.h' for a list of keycodes.

See also:

Definition at line 239 of file system.h.

Member Data Documentation

CharScanType KeyDownEvent::charScan

The same as above, but splitted in its two components.

See also:

Definition at line 254 of file system.h.

ulong KeyDownEvent::controlKeyState

Stores the status of the control keys when the event happened. The following values define keyboard states, and can be used when examining the keyboard shift state:

 Constant      Value  Meaning

 kbRightShift  0x0001 Set if the Right Shift key is currently down
 kbLeftShift   0x0002 Set if the Left Shift key is currently down
 kbCtrlShift   0x0004 Set if the Ctrl key is currently down
 kbAltShift    0x0008 Set if the Alt key is currently down
 kbScrollState 0x0010 Set if the keyboard is in the Scroll Lock state
 kbNumState    0x0020 Set if the keyboard is in the Num Lock state
 kbCapsState   0x0040 Set if the keyboard is in the Caps Lock state
 kbInsState    0x0080 Set if the keyboard is in the Ins Lock state

Its value is 0 if none of these keys was pressed. Warning: this information is not reliable. Its value depends on your operating system and libraries (gpm, ncurses). Usually only a subset of these flags are detected. See file `' for details.

Definition at line 279 of file system.h.

ushort KeyDownEvent::keyCode

This is the key code.

It is the concatenation of the scan code and the character code.

See also:

Definition at line 249 of file system.h.

The documentation for this struct was generated from the following file:
Generated at Sat Sep 22 20:19:27 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001