Altova XMLSpy 2025 Professional Edition

Enumeration type for the most frequently used key masks that identify the status of the virtual keys. Use these values as bitmasks rather then directly comparing with them. When necessary, you can create further masks by using the 'logical or' operator.

 

spyNoVirtualKeyMask

= 0

spyLeftShiftKeyMask

= 1

spyRightShiftKeyMask

= 2

spyLeftCtrlKeyMask

= 4

spyRightCtrlKeyMask

= 8

spyLeftAltKeyMask

= 16

spyRightAltKeyMask

= 32

spyShiftKeyMask

= 3        // spyLeftShiftKeyMask | spyRightShiftKeyMask

spyCtrlKeyMask

= 12        // spyLeftCtrlKeyMask | spyRightCtrlKeyMask

spyAltKeyMask

= 48        // spyLeftAltKeyMask | spyRightAltKeyMask

 

Examples

 

'  VBScript sample: check if ctrl-key is pressed

If ((i_nVirtualKeyStatus And spyCtrlKeyMask) <> 0)) Then

 ' ctrl-key is pressed

End If

 

'  VBScript sample: check if ONLY ctrl-key is pressed

If (i_nVirtualKeyStatus == spyCtrlKeyMask) Then

 ' exactly ctrl-key is pressed

End If

 

// JScript sample: check if any of the right virtual keys is pressed

if ((i_nVirtualKeyStatus & (spyRightShiftKeyMask | spyRightCtrlKeyMask | spyRightAltKeyMask)) != 0)

{

 ; ' right virtual key is pressed

}

 

© 2018-2024 Altova GmbH