isAltPressed property
Returns true if a logical ALT modifier key is pressed, regardless of which side of the keyboard it is on.
The AltGr
key that appears on some keyboards is considered to be the
same as LogicalKeyboardKey.altRight on some platforms (notably Android).
On platforms that can distinguish between altRight
and altGr
, a press
of AltGr
will not return true here, and will need to be tested for
separately.
Use isLogicalKeyPressed if you need to know which alt key was pressed.
Implementation
bool get isAltPressed {
return isLogicalKeyPressed(LogicalKeyboardKey.altLeft) || isLogicalKeyPressed(LogicalKeyboardKey.altRight);
}