isModifierPressed method
- ModifierKey key,
- int modifiers, {
- KeyboardSide side = KeyboardSide.any,
- required int keyCode,
- required bool isDown,
override
Returns true if the given ModifierKey was pressed at the time of this event.
Implementation
@override
bool isModifierPressed(ModifierKey key, int modifiers, {KeyboardSide side = KeyboardSide.any, required int keyCode, required bool isDown}) {
modifiers = _mergeModifiers(modifiers: modifiers, keyCode: keyCode, isDown: isDown);
return switch (key) {
ModifierKey.controlModifier => modifiers & modifierControl != 0,
ModifierKey.shiftModifier => modifiers & modifierShift != 0,
ModifierKey.altModifier => modifiers & modifierAlt != 0,
ModifierKey.metaModifier => modifiers & modifierMeta != 0,
ModifierKey.capsLockModifier => modifiers & modifierCapsLock != 0,
ModifierKey.numLockModifier => modifiers & modifierNumericPad != 0,
// These are not used in GLFW keyboards.
ModifierKey.functionModifier => false,
ModifierKey.symbolModifier => false,
ModifierKey.scrollLockModifier => false,
};
}