Skip to content

KeyModifiers

1 min read

Import: import system.window;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

KeyModifiers

Modifier keys and lock states held while a key event happened. The choices are bit flags. Test one with &, for example (key.modifiers & KeyModifiers.Shift) != KeyModifiers.None.

public enum KeyModifiers

None

No modifier was held.

None = 0

Shift

Either Shift key was held.

Shift = 1

Control

Either Control key was held.

Control = 2

Alt

Either Alt (Option) key was held.

Alt = 4

Meta

Either Meta key (Command on macOS, Windows key on Windows) was held.

Meta = 8

CapsLock

Caps Lock was on.

CapsLock = 16

NumLock

Num Lock was on.

NumLock = 32