Altova XMLSpy 2024 Professional Edition

Enumeratiostyp für die am häufigsten verwendeten Tastaturmasken, die den Status der virtuellen Tasten identifizieren. Verwenden Sie diese Werte als Bitmasken, anstatt direkte Vergleiche damit durchzuführen. Wenn nötig können Sie mit Hilfe des 'logical or' Operators weitere Masken erstellen.

 

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

 

Beispiele

 

'  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

}

 

© 2017-2023 Altova GmbH