Jump to content

KbdPeek: Difference between revisions

From EDM2
Created page with "==Description== Returns a keyboard-character data record, if available, but does not remove it from the queue. ==Syntax== <PRE> #define INCL_KBD #include <os2.h> PKBDKEYINFO..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Description==
Returns a keyboard-character data record, if available, but does not remove it from the queue.
Returns a keyboard-character data record, if available, but does not remove it from the queue.


==Syntax==
==Syntax==
<PRE>
KbdPeek (CharData, hkbd)
#define INCL_KBD
#include <os2.h>


PKBDKEYINFO    CharData;  /*  Pointer to character data. */
HKBD          hkbd;      /*  Reserved.  Must be 0. */
APIRET        rc;        /*  Return code. */
rc = KbdPeek(CharData, hkbd);
</PRE>
==Parameters==
==Parameters==
; CharData (PKBDKEYINFO) - output : Pointer to character data.
;CharData (PKBDKEYINFO) - output : Pointer to character data.
A pointer to a KBDKEYINFO structure in which the character data is returned.  
:A pointer to a KBDKEYINFO structure in which the character data is returned.
;hkbd (HKBD) - input : Reserved. Must be 0.


; hkbd (HKBD) - input : Reserved. Must be 0.
==Return Code==
==Return Code==
rc (APIRET) - returns
;rc (APIRET) - returns:KbdPeek returns one of the following values:
 
*0 NO_ERROR
KbdPeek returns one of the following values:
*375 ERROR_KDB_INVALID_IOWAIT
 
*439 ERROR_KBD_INVALID_HANDLE
* 0         NO_ERROR.
*445 ERROR_KBD_FOCUS_REQUIRED
* 375       ERROR_KDB_INVALID_IOWAIT  
*447 ERROR_KBD_KEYBOARD_BUSY
* 439       ERROR_KBD_INVALID_HANDLE  
*504 ERROR_KBD_EXTENDED_SG
* 445       ERROR_KBD_FOCUS_REQUIRED  
* 447       ERROR_KBD_KEYBOARD_BUSY  
* 504       ERROR_KBD_EXTENDED_SG  
 
 


==Remarks==
==Remarks==
Line 38: Line 23:
If bit 0 of fbStatus is set, the character returned is either 0 or 0xe0. The Unicode character contains the virtual key.
If bit 0 of fbStatus is set, the character returned is either 0 or 0xe0. The Unicode character contains the virtual key.


For valid characters, the character in the current code page is returned, and the Unicode character contains the Unicode encoding of the character.  
For valid characters, the character in the current code page is returned, and the Unicode character contains the Unicode encoding of the character.
 
==Example Code==
<PRE>
 
</PRE>
==Related Functions==
*
 


[[Category:The OS/2 API Project]]
[[Category:Kbd]]

Latest revision as of 18:15, 6 January 2023

Returns a keyboard-character data record, if available, but does not remove it from the queue.

Syntax

KbdPeek (CharData, hkbd)

Parameters

CharData (PKBDKEYINFO) - output
Pointer to character data.
A pointer to a KBDKEYINFO structure in which the character data is returned.
hkbd (HKBD) - input
Reserved. Must be 0.

Return Code

rc (APIRET) - returns
KbdPeek returns one of the following values:
  • 0 NO_ERROR
  • 375 ERROR_KDB_INVALID_IOWAIT
  • 439 ERROR_KBD_INVALID_HANDLE
  • 445 ERROR_KBD_FOCUS_REQUIRED
  • 447 ERROR_KBD_KEYBOARD_BUSY
  • 504 ERROR_KBD_EXTENDED_SG

Remarks

Note: KbdPeek returns a complete keystroke. This behavior is unlike the OS/2 1.3 version, which returned only a single byte. This is significant only for DBCS characters.

If bit 0 of fbStatus is set, the character returned is either 0 or 0xe0. The Unicode character contains the virtual key.

For valid characters, the character in the current code page is returned, and the Unicode character contains the Unicode encoding of the character.