KbdGetConsole: Difference between revisions
Appearance
mNo edit summary |
m Ak120 moved page OS2 API:CPI:KbdGetConsole to KbdGetConsole |
(No difference)
|
Revision as of 05:01, 6 January 2017
Reads a key, mouse event, or a notification from the console.
Syntax
#define INCL_KBD #include <os2.h> PVOID Data; /* Pointer to event data. */ PULONG Kind; /* Kind of event returned. */ ULONG Flag; /* Wait for a keystroke flag. */ HKBD hkbd; /* Reserved. Must be 0. */ APIRET return; /* Return code. */ return = KbdGetConsole(Data, Kind, Flag, hkbd);
Parameters
- Data (PVOID) - output
- Pointer to event data.
- A pointer to a location where the event data is returned. The data type returned depends on the kind of event returned. For keyboard events, the data type returned is KBDKEYINFO. For mouse events, the data type returned is MOUQUEINFO.
- Kind (PULONG) - output
- Kind of event returned.
- One of the following values is returned:
- 0 - No event available
- 1 - Keyboard event (not a valid character)
- 2 - Character
- 3 - Mouse event
- 4 - Notification
- Flag (ULONG) - input
- Wait for a keystroke flag.
- The possible values are:
- 0 IO_WAIT Wait for an event if one is not available. The event returned is removed from queue.
- 1 IO_NOWAIT Return immediately, with or without an event. If an event is returned, removed it from the queue.
- 2 IO_PEEK Return immediately, with or without an event. Do not remove the event from the queue.
- 3 IO_PEEKWAIT Wait for an event if one is not available. Return the event but do not remove it from the queue.
- hkbd (HKBD) - input
- Reserved. Must be 0.
Return Code
return (APIRET) - returns
KbdGetConsole returns one of the following values:
- 0 NO_ERROR.
- 375 ERROR_KBD_INVALID_HANDLE
- 439 ERROR_KBD_INVALID_IOWAIT
- 464 ERROR_KBD_DETACHED
Remarks
KbdGetConsole allows the retrieval of either a keyboard event or mouse event. This should be used by programs using both input devices. See KbdCharIn and MouReadEventQue for details of the returned values and conditions.
Only those mouse events enabled by the event mask are returned. By default, the event mask is disabled.