Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 Module RTKeybrd |
Module RTKeybrdRTKeybrd contains functions KBGetCh, KBKeyPressed, and KBPutCh (to insert keystrokes into the keyboard buffer by software). RTKeybrd releases the CPU for other tasks while waiting for keyboard input. Multitasking programs requiring keyboard input should utilize RTKeybrd in order to make CPU time available to other tasks that would otherwise be wasted waiting for keyboard input. RTKeybrd hooks into RTTarget-32's user input event manager. All functions waiting for user input (e.g., KBGetCh, Win32 console I/O functions or C/C++ run-time systems functions) will block the calling task, freeing CPU time for other tasks. A keyboard interrupt will then reactivate the respective task instantaneously. RTKeybrd declares a binary semaphore which is set by every keyboard interrupt. Applications can wait on this semaphore (e.g., to be able to wait for keyboard input with a timeout). Please note that setting semaphore KBKeyAvailable does not guarantee that a key is available in the keyboard buffer. It only means that some kind of keyboard event has occurred (e.g., a key was released). The functions of module RTKeybrd are declared in header file Rtkeybrd.h and are documented in the RTKernel-32 Reference Manual.
|