OnKeyPress picture event


Declaration

ENTRY OnKeyPress(IN INT _VKCode, IN BOOL _bCtrl, IN BOOL _bShift, IN BOOL _bAlt)
 ; script actions
 END OnKeyPress


Parameters
_VKCode Code of pressed key.
_bCtrl Attribute of the CTRL key state when the key _VKCode is pressed.
_bShift Attribute of the SHIFT key state when the key _VKCode is pressed.
_bAlt Attribute of the ALT key state when the key _VKCode is pressed.

Description
The picture event is being generated when any key is pressed above the picture. The value of the parameter _VKCode uniquely identifies the pressed key. The next three parameters identifies the states of the CTRL, SHIFT and ALT keys.
Codes assigned to keys are constants and they are defined by OS OS MS Windows.
Example
The example contains en easy method to detect the values of the parameter _VKCode for keys.
 
ENTRY OnKeyPress(IN INT _VKCode, IN  BOOL _bCtrl, IN  BOOL  _bShift, IN  BOOL _bAlt)
   TEXT _msg
 
   _msg := "_VKCode = " + %IToStr(_VKCode)
   IF _bCtrl THEN
     _msg := _msg + " +CTRL"
   ENDIF
   IF _bAlt THEN
     _msg := _msg + " +ALT"
   ENDIF
   IF _bShift THEN
     _msg := _msg + " +SHIFT"
   ENDIF
   MESSAGE _msg ON _FROM_HIP
 END OnKeyPress

Napíšte komentár