Click or drag to resize

KeyEvent Class

X#
Provide information about a KeyEvent, used to encapsulate information about the key that was pressed.
Inheritance Hierarchy
Object
  Event
    KeyEvent

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 CLASS KeyEvent INHERIT Event
Request Example View Source

The KeyEvent type exposes the following members.

Constructors
  NameDescription
Public methodKeyEvent
Initializes a new instance of the KeyEvent class
Top
Properties
  NameDescription
Public propertyASCIIChar
A numeric value representing the normal ASCII code for the key that caused this KeyEvent.
Public propertyHandle
The pointer to the window where the event occurred
(Inherited from Event.)
Public propertyKeyCode
A constant, indicating the code for the key that was pressed:
Public propertyMessage
A dword representing the Windows API message associated with the given event.
(Inherited from Event.)
Public propertyRepeatCount
A numeric value determining whether a user depressed a key repeatedly or held it down for an extended period of time.
Public propertySystem
A logical value determining whether the Alt key was pressed at the same time as another key (TRUE if yes, FALSE if no).
Public propertyWindow
An object indicating the window or control in which the event occurred. This is helpful, for example, for distinguishing between similar menu events coming from the same context menu attached to different controls.
(Inherited from Event.)
Top
Fields
  NameDescription
Public fieldhWnd (Inherited from Event.)
Public fieldlParam (Inherited from Event.)
Public fieldoWindow (Inherited from Event.)
Public fielduMsg (Inherited from Event.)
Public fieldwParam (Inherited from Event.)
Top
Remarks
KeyEvent events occur when the keyboard is used and are sent to Window:KeyDown() and Window:KeyUp().
Examples
This example moves the text cursor down one line when the user presses the Enter key. oCursorPoint defines the current location of the text cursor.
X#
1METHOD KeyDown(aKeyEvt) CLASS TopAppWindow
2IF(aKeyEvt:KeyCode() = KeyEnter)
3ts := SELF:TextSize('A'):Height() + 2
4oCursorPoint := Point{10,oCursorPoint:Y() - ts}
5ENDIF
See Also

Reference