IDLitWindow::OnKeyboard

Syntax | Arguments | Keywords | Implementing the OnKeyboard Interface | Version History | See Also

The IDLitWindow::OnKeyboard procedure method handles notification (from the native window device) that a keyboard event has occurred, and passes along that notification to all observers in the list of window event observers (as specified by calls to the IDLitWindow::AddWindowEventObserver method). You can also simulate a keyboard event by calling this method directly.

Note
Window event observers that handle keyboard events must implement the OnKeyboard method, as described in Implementing the OnKeyboard Interface. In addition, window event observers must implement the OnMouseDown, OnMouseMotion, and OnMouseUp methods. See IDLitWindow::AddWindowEventObserver for details.

Syntax

Obj->[IDLitWindow::]OnKeyboard, IsASCII, Character, KeySymbol, X, Y, Press, Release, Modifiers

Arguments

IsASCII

A scalar byte value that indicates whether the keyboard event corresponds to a character in the ASCII character set. If IsASCII is non-zero, the Character argument will be set to that ASCII character. If IsASCII is zero, the KeySymbol argument will be set to a numeric value indicating the key that was pressed.

Character

If IsASCII is non-zero, this argument is set to a byte value containing the ASCII character that corresponds to the key that was pressed. Otherwise, this argument is set to zero.

KeySymbol

If IsASCII is zero, this argument is set to a long integer that indicates the key that was pressed. Otherwise, this argument is set to zero. Valid values for key symbols include:

1

Shift

2

Control

3

Caps Lock

4

Alt

5

Left

6

Right

7

Up

8

Down

9

Page Up

10

Page Down

11

Home

12

End

X,Y

Long integers containing the x-coordinate and y-coordinate of the mouse cursor (in device coordinates) at the time of the event.

Press

A long integer indicating whether this event represents a key press. This argument is non-zero if the event is the result of pressing the key.

Release

A long integer indicating whether this event represents a key release. This argument is non-zero if the event is the result of releasing the key.

Modifiers

A long integer containing a bitwise mask indicating which modifier keys are active at the time of the keyboard event. If a bit is zero, the key is up; if the bit is set, the key is pressed. The following table describes the bits in this bit mask:

Table 32-15: Modifier Values

Bit
Value
Modifier Key
0
1
Shift
1
2
Control
2
4
Caps Lock
3
8
Alt

Keywords

None

Implementing the OnKeyboard Interface

When defining a window event observer that handles keyboard events, you must implement an OnKeyboard procedure method with the following signature:

PRO OnKeyboard, Window, IsASCII, Character, KeySymbol, X, Y, $ 
   Press, Release, Modifiers  

where the Window argument is an object reference to the IDLitWindow object in which the event was generated, and all of the other arguments are described above.

In addition, you must implement OnMouseDown, OnMouseMotion, and OnMouseUp procedure methods, as discussed in IDLitWindow::AddWindowEventObserver.

Version History

6.0

Introduced

6.1

Corrected syntax to read IsASCII instead of IsAlphaNumeric

Corrected KeySymbol values

Added X, Y, Press, Release, Modifiers arguments

See Also

IDLitWindow::AddWindowEventObserver, IDLitWindow::OnMouseDown, IDLitWindow::OnMouseMotion, IDLitWindow::OnMouseUp