X11workbench Toolkit  1.0
Keyboard Event Handling


#define WB_KEYEVENT_KEYSYM   8 /* bit flags for 'piAltCtrlShift' below */
 'AltCtrlShift' bit flag for 'VK_' keys for WBKeyEventProcessKey()
#define WB_KEYEVENT_ALT   4
 'AltCtrlShift' bit flag for ALT modifier for WBKeyEventProcessKey()
#define WB_KEYEVENT_CTRL   2
 'AltCtrlShift' bit flag for Control modifier for WBKeyEventProcessKey()
 'AltCtrlShift' bit flag for Shift modifier for WBKeyEventProcessKey()
 'AltCtrlShift' bit mask for Alt+Ctrl+Shift bits for WBKeyEventProcessKey()


int WBKeyEventProcessKey (const XKeyEvent *pEvent, char *pBuf, int *pcbLen, int *piAltCtrlShift)
 Generic keyboard event translation utility. More...


 keystroke/character notifications generated by API More...

Detailed Description

The X11workbench Toolkit API provides for mid-level keyboard event handling via WB_CHAR ClientMessage notification events.
See aWB_CHAR for more info.

Function Documentation

◆ WBKeyEventProcessKey()

int WBKeyEventProcessKey ( const XKeyEvent *  pEvent,
char *  pBuf,
int *  pcbLen,
int *  piAltCtrlShift 

Generic keyboard event translation utility.

pEventA const pointer to an XKeyEvent structure to process
pBufA buffer to receive translated keystroke information (may be NULL, see below)
pcbLenA pointer to an integer (pre-assigned to the length of pBuf) that receives the actual data length (see below) (may be NULL)
piAltCtrlShiftA pointer to an integer that receives bit flags associated with CTRL ALT and SHIFT states (may be NULL)
The first byte of the character string when 'pBuf' is NOT NULL, or a translated UTF character of 1, 2, or 4 bytes when pBuf is NULL

generic utility to process a keystroke. 'pcbLen' must be pre-assigned to size of 'pBuf' if 'pBuf' is to be written to. Any parameter other than 'pEvent' may be NULL. when pBuf is NULL, pcbLen (if not NULL) receives the required length in bytes when pcbLen is NULL and pBuf is not, length is assumed to be 1 byte return value is the first byte of the character string when 'pBuf' is NOT NULL, or a translated UTF character of 1, 2 or 4 bytes (when pBuf is NULL).

See also

Header File: window_helper.h

Definition at line 6681 of file window_helper.c.

Variable Documentation



keystroke/character notifications generated by API

Mid-level keystroke handling generates WB_CHAR notifications via ClientMessage passed to the appropriate window in addition to normal key up/down events.

WB_CHAR notification message format (relative to XEvent.xclient)

type == ClientMessage
message_type == aWB_CHAR
format == 32 (always)
data.l[0] is return from WBKeyEventProcessKey
data.l[1] is *piAltCtrlShift from WBKeyEventProcessKey
data.l[2] is # of characters decoded into data.l[3..4]
data.l[3..4] (as char[]) is decode buffer (at least 8 chars long, possibly 16 for 64-bit)

see also: WBKeyEventProcessKey()character notifications (generated by API; avoids key up/down handling)

Definition at line 398 of file window_helper.c.