Jump to content

KbdGetConsole: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
  KbdGetConsole(Data, Kind, Flag, hkbd)
#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);
</PRE>


==Parameters==
==Parameters==
;Data (PVOID) - output : Pointer to event data.
;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.
: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.
;Kind (PULONG) - output: Kind of event returned.
:One of the following values is returned:
:One of the following values is returned:
::0 - No event available  
::0 - No event available
::1 - Keyboard event (not a valid character)  
::1 - Keyboard event (not a valid character)
::2 - Character  
::2 - Character
::3 - Mouse event  
::3 - Mouse event
::4 - Notification  
::4 - Notification
;Flag (ULONG) - input : Wait for a keystroke flag.
;Flag (ULONG) - input: Wait for a keystroke flag.
:The possible values are:
:The possible values are:
::0 IO_WAIT Wait for an event if one is not available. The event returned is removed from queue.
::0 IO_WAIT Wait for an event if one is not available. The event returned is removed from queue.
Line 31: Line 20:
::2 IO_PEEK Return immediately, with or without an event. Do not remove the event 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.
::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.
;hkbd (HKBD) - input: Reserved. Must be 0.


==Return Code==
==Return Code==
return (APIRET) - returns
;return (APIRET) - returns:KbdGetConsole returns one of the following values:
KbdGetConsole returns one of the following values:
*0 NO_ERROR
*0 NO_ERROR.
*375 ERROR_KBD_INVALID_HANDLE
*375 ERROR_KBD_INVALID_HANDLE  
*439 ERROR_KBD_INVALID_IOWAIT
*439 ERROR_KBD_INVALID_IOWAIT  
*464 ERROR_KBD_DETACHED
*464 ERROR_KBD_DETACHED


==Remarks==
==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.
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.
Only those mouse events enabled by the event mask are returned. By default, the event mask is disabled.


[[Category:Kbd]]
[[Category:Kbd]]

Latest revision as of 03:13, 2 January 2020

Reads a key, mouse event, or a notification from the console.

Syntax

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.