DisplayKeyboardEvents

Top  Previous  Next

Message

 

DisplayKeyboardEvents <docname> up|down|both|none

 

Originator

 

Client

 

Response

 

SyntaxError: insufficient parameters to DisplayKeyboardEvents

SyntaxError: invalid parameters to DisplayKeyboardEvents

SyntaxError: second parameter must be up/down/both/none

Error: document docname not found by DisplayKeyboardEvents

Info: keyboard events set

 

Response (immediate socket)

 

Success

Failure

 

Details

 

Enables or disables keyboard events for the document.

 

If the second parameter is 'down', pressing a key generates an event. If the second parameter is 'up', only releasing a key generates an event. If the second parameter is 'both', both the pressing and releasing of a key generate events. If it is 'none', then no key events are generated.

 

Keyboard events are only useful for situations in which a single subject is being tested using a single display device. Thus, keyboard events are only generated if (1) the client has enabled keyboard events for a document; (2) the document is being displayed in a window; (3) the window has the input focus. The authors only envisage this being useful for human testing.

 

When a keyboard event is generated, the following message is sent to the client:

 

KeyEvent: <char> <updown> <docname>

 

where

 

char is the Windows virtual-key code of the key in question;

updown is "down" if the key was depressed and "up" if it was released;

docname is the name of the document that generated the event.

 

Keys pressed while the ALT key is held down are ignored.
Keyboard repeat events are specifically ignored (i.e. if you depress a key, Windows will generate a stream of events, but Whisker will prevent all but the first message from getting to the client – the next message that can be sent is the release of the same key). It's an operant control system, not a word processor.
Certain keys (e.g. ALT) do not generate events. You cannot request events for specific keys (mainly because this would be somewhat tedious; if you feel this is a limitation, contact Rudolf Cardinal at rudolf@pobox.com.)
You cannot ask the server whether a specific key is up or down at a given instant.
Obviously, keyboard events can be set up for several documents simultaneously, and/or by several clients, but the Windows focus can only be in one window (document) at a time, and events are directed to that document's client.
The key codes are shown in the charts on the following pages.

 

Revision history

 

Implemented by WhiskerServer version 2.3.

 

See also

 

Keyboard code values
Display devices
KeyEvent
DisplayShowDocument