InputEventWithModifiers
Common event base with modifier flags.
Flags describe a particular event, not keyboard state at the time it is read later. They can be assigned programmatically in InputEventKey, mouse events and other appropriate subclasses. Do not determine a standalone Ctrl or Shift key press solely from another event's modifier flags.
CommandOrControlAutoremap supports platform shortcuts but changes CtrlPressed/MetaPressed when toggled. IsCommandOrControlPressed reads the selected event flag; that is a different question from whether autoremap is enabled.
GetModifiersMask returns KeyModifierMask bits. InputEventKey provides separate GetKeycodeWithModifiers, GetPhysicalKeycodeWithModifiers and GetKeyLabelWithModifiers methods to combine a key code with that mask.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties5
AltPressedProperty
public bool AltPressed { get; set; }Alt flag in this event's data, not a continuous keyboard-state query. Can be assigned programmatically.
CommandOrControlAutoremapProperty
public bool CommandOrControlAutoremap { get; set; }Selects the platform shortcut modifier: Ctrl in the current Windows build, Meta on platforms that prefer it. Enabling sets one flag and clears the other; disabling clears both. Direct CtrlPressed/MetaPressed assignment is prohibited while enabled. Does not mean a physical key is currently held.
CtrlPressedProperty
public bool CtrlPressed { get; set; }Ctrl flag in this event's data, not a continuous keyboard-state query. Can be assigned programmatically. Direct CtrlPressed/MetaPressed changes are rejected by a native check while CommandOrControlAutoremap = true; do not rely on a CLR exception.
MetaPressedProperty
public bool MetaPressed { get; set; }Meta flag in this event's data, not a continuous keyboard-state query. Can be assigned programmatically. Direct CtrlPressed/MetaPressed changes are rejected by a native check while CommandOrControlAutoremap = true; do not rely on a CLR exception.
ShiftPressedProperty
public bool ShiftPressed { get; set; }Shift flag in this event's data, not a continuous keyboard-state query. Can be assigned programmatically.
Methods12
GetModifiersMaskKeyModifierMask
public KeyModifierMask GetModifiersMask();Combines active Shift, Alt, Ctrl and Meta flags into KeyModifierMask. This is a modifier mask, not the main key code. Autoremap uses the platform-selected Ctrl/Meta modifier.
KeyModifierMaskKeyModifierMask bit combination; 0 when no modifiers are present.
IsAltPressedbool
public bool IsAltPressed();Returns AltPressed without modifying the event or polling the device.
boolCurrent boolean AltPressed value.
IsCommandOrControlAutoremapbool
public bool IsCommandOrControlAutoremap();Returns CommandOrControlAutoremap without modifying the event or polling the device.
boolCurrent boolean CommandOrControlAutoremap value.
IsCommandOrControlPressedbool
public bool IsCommandOrControlPressed();Reads CtrlPressed or MetaPressed according to the platform preference. Does not test whether CommandOrControlAutoremap is enabled or poll the live keyboard.
boolThis event's platform-selected Ctrl/Meta flag.
IsCtrlPressedbool
public bool IsCtrlPressed();Returns CtrlPressed without modifying the event or polling the device.
boolCurrent boolean CtrlPressed value.
IsMetaPressedbool
public bool IsMetaPressed();Returns MetaPressed without modifying the event or polling the device.
boolCurrent boolean MetaPressed value.
IsShiftPressedbool
public bool IsShiftPressed();Returns ShiftPressed without modifying the event or polling the device.
boolCurrent boolean ShiftPressed value.
SetAltPressedvoid
public void SetAltPressed(bool pressed);Sets AltPressed with the same rules and flag side effects as the property.
| Name | Type | Default |
|---|---|---|
pressed | bool | — |
pressedNew boolean AltPressed value.
SetCommandOrControlAutoremapvoid
public void SetCommandOrControlAutoremap(bool enable);Sets CommandOrControlAutoremap with the same rules and flag side effects as the property.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableNew boolean CommandOrControlAutoremap value.
SetCtrlPressedvoid
public void SetCtrlPressed(bool pressed);Sets CtrlPressed with the same rules and flag side effects as the property.
| Name | Type | Default |
|---|---|---|
pressed | bool | — |
pressedNew boolean CtrlPressed value.
SetMetaPressedvoid
public void SetMetaPressed(bool pressed);Sets MetaPressed with the same rules and flag side effects as the property.
| Name | Type | Default |
|---|---|---|
pressed | bool | — |
pressedNew boolean MetaPressed value.
SetShiftPressedvoid
public void SetShiftPressed(bool pressed);Sets ShiftPressed with the same rules and flag side effects as the property.
| Name | Type | Default |
|---|---|---|
pressed | bool | — |
pressedNew boolean ShiftPressed value.