Functions | |
void | Show_Button_Source (char *keyboard, char *button, int *status) |
Returns the keyboard-device segment and the button specification that gave rise to the current button event. More... | |
void Show_Button_Source | ( | char * | keyboard, |
char * | button, | ||
int * | status | ||
) |
Returns the keyboard-device segment and the button specification that gave rise to the current button event.
keyboard | - The segment associated with the physical keyboard device that initiated the current event. Passed by reference always. Returned to user. |
button | - The buttonspecification that allowed the current event. Almost always the same as the return value of Show_Button() , but might also be "anything". Passed by reference always. Returned to user. |
status | - Bit-encoded value representing the state (or the new state, if the state just changed) of the keyboard. Passed by reference always. Returned to user. |
Show_Button_Source() is one of a family of routines that extracts information from the current event (presumably a button event) and returns it to you. In particular, Show_Button_Source() returns the keyboard device and keystroke combination that was originally enabled for button events, and which gave rise to the event now at hand. This information might be of interest if your program is handling several different button devices simultaneously.
Status is a device-dependent bit-encoded value that represents the state of the keyboard or keypad at the time of the event. Basically, it shows you what extra keys were simultaneously pressed beyond the usual "shift" and "control" keys. If the first modifier key was currently pressed, then bit zero will be on. If the second modifier key was currently pressed, then bit one will be on independently of the state of bit zero, etc.
If you're using the status value it should mean that you're sure of the kind of keyboard and operating system interface you're going to have—none of the bits of status are guaranteed to exist. (If a bit has no definition, it will always be set to zero.)
If your programming language doesn't allow for testing bit N of integer status, an equivalent test you might use is