Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/src/manager/shortcut/pluto_grid_shortcut.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ class PlutoGridShortcut {
required PlutoGridStateManager stateManager,
required HardwareKeyboard state,
}) {
// Remove NumLock before checking shortcuts. This will enable the arrow
// keys and shortcuts to work correctly on Linux too.
final Set<LogicalKeyboardKey> filteredKeys = state.logicalKeysPressed
.where((key) => key != LogicalKeyboardKey.numLock)
.toSet();
// Create a fake state object with filtered keys.
final HardwareKeyboard fakeState = HardwareKeyboard.instance;
fakeState.logicalKeysPressed.clear();
fakeState.logicalKeysPressed.addAll(filteredKeys);

for (final action in actions.entries) {
if (action.key.accepts(keyEvent.event, state)) {
if (action.key.accepts(keyEvent.event, fakeState)) {
action.value.execute(keyEvent: keyEvent, stateManager: stateManager);
return true;
}
Expand Down