Options
All
  • Public
  • Public/Protected
  • All
Menu

This data structure represents the state of modifier keys at a specific point in time.

Properties

altKey: boolean

True if the alt was pressed along with execute key/click

ctrlKey: boolean

True if the ctrl was pressed along with execute key/click

metaKey: boolean

True if the meta was pressed along with execute key/click

modifierBitfield: KeyBitfield

A bit field containing the state of all four modifier keys

Bit Modifier
1 ctrlKey
2 altKey
4 shiftKey
8 metaKey
example:

The ctrl + shift keys were being pressed (and no others), then modifierBitfield = (1 + 4) = 5

example:

The alt key was being pressed (and no others), then modifierBitfield = 2

example:

Check that the shift key was being pressed (regardless of others), then (modifierBitfield & 4) > 0

shiftKey: boolean

True if the shift was pressed along with execute key/click

Generated using TypeDoc