ZenWINX Logo ZenWINX

Architecture - Reference Manual - Guides

Keyboard

Functions

char *__stdcall winx_get_error_description (unsigned long status)
 Retrieves a human readable explaination of the NT status code.
void __stdcall kb_close (void)
 Closes all opened keyboards.
int __stdcall kb_check (HANDLE hKbDevice)
 Checks the keyboard for an existence.
int __stdcall kb_open_internal (int device_number)
 Opens the keyboard.
int __stdcall kb_read_internal (int kb_index, PKEYBOARD_INPUT_DATA pKID, PLARGE_INTEGER pInterval)
 Checks the keyboard for an input.
int __stdcall kb_open (void)
 Opens all existing keyboards.
int __stdcall kb_read (PKEYBOARD_INPUT_DATA pKID, int msec_timeout)
 Checks the console for keyboard input.
int __stdcall kb_light_up_indicators (HANDLE hKbDevice, USHORT LedFlags)
 Light up the keyboard indicators.

Function Documentation

char* __stdcall winx_get_error_description ( unsigned long  status  ) 

Retrieves a human readable explaination of the NT status code.

Parameters:
[in] status the NT status code.
Returns:
A pointer to string containing the status explaination.
Note:
This function returns explainations only for well known codes. Otherwise it returns an empty string.
Example:
 printf("%s\n",winx_get_error_description(STATUS_ACCESS_VIOLATION));
 // prints "Access violation".

Definition at line 266 of file dbg.c.

Referenced by kb_open_internal(), kb_read_internal(), and winx_dbg_print_ex().

void __stdcall kb_close ( void   ) 

Closes all opened keyboards.

Note:
Internal use only.

Definition at line 92 of file keyboard.c.

Referenced by winx_exit(), winx_reboot(), and winx_shutdown().

int __stdcall kb_check ( HANDLE  hKbDevice  ) 

Checks the keyboard for an existence.

Parameters:
[in] hKbDevice the handle of the keyboard device.
Returns:
Zero for success, negative value otherwise.
Note:
Internal use only.

Definition at line 271 of file keyboard.c.

References kb_light_up_indicators(), and winx_sleep().

Referenced by kb_open_internal().

int __stdcall kb_open_internal ( int  device_number  ) 

Opens the keyboard.

Parameters:
[in] device_number the number of the keyboard device.
Returns:
Zero for success, negative value otherwise.
Note:
Internal use only.

Definition at line 164 of file keyboard.c.

References kb_check(), winx_get_error_description(), and winx_printf().

Referenced by kb_open().

int __stdcall kb_read_internal ( int  kb_index,
PKEYBOARD_INPUT_DATA  pKID,
PLARGE_INTEGER  pInterval 
)

Checks the keyboard for an input.

Parameters:
[in] kb_index the index of the keyboard to be checked.
[out] pKID pointer to the structure receiving keyboard input.
[in] pInterval pointer to the variable holding the time-out interval.
Returns:
Zero if some key was pressed, negative value otherwise.
Note:
Internal use only.

Definition at line 315 of file keyboard.c.

References winx_exit(), winx_get_error_description(), and winx_printf().

Referenced by kb_read().

int __stdcall kb_open ( void   ) 

Opens all existing keyboards.

If checking of first keyboard fails wait ten seconds for the initialization. This is needed for wireless devices.

Returns:
Zero for success, negative value otherwise.
Note:
Internal use only.

Definition at line 57 of file keyboard.c.

References kb_open_internal(), winx_printf(), and winx_sleep().

Referenced by winx_init().

int __stdcall kb_read ( PKEYBOARD_INPUT_DATA  pKID,
int  msec_timeout 
)

Checks the console for keyboard input.

Tries to read from all keyboard devices until specified time-out expires.

Parameters:
[out] pKID pointer to the structure receiving keyboard input.
[in] msec_timeout time-out interval in milliseconds.
Returns:
Zero if some key was pressed, negative value otherwise.
Note:
Internal use only.

Definition at line 116 of file keyboard.c.

References kb_read_internal().

Referenced by winx_breakhit(), winx_getch(), winx_kbhit(), and winx_prompt().

int __stdcall kb_light_up_indicators ( HANDLE  hKbDevice,
USHORT  LedFlags 
)

Light up the keyboard indicators.

Parameters:
[in] hKbDevice the handle of the keyboard device.
[in] LedFlags the flags specifying which indicators must be lighten up.
Returns:
Zero for success, negative value otherwise.
Note:
Internal use only.

Definition at line 244 of file keyboard.c.

Referenced by kb_check().


Generated on Sat May 29 23:06:45 2010 for ZenWINX by doxygen 1.6.2