Skip to content

Commit

Permalink
Added network related shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Nov 21, 2024
1 parent 718bdb1 commit 028ea60
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lib/src/services/shortcuts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,43 @@ class ShortcutsService extends Service {
}
},
);

register(
ShortcutKey(
[LogicalKeyboardKey.keyK],
modifiers: [KeyModifier.control],
identifier: "connect to rover",
),
callback: () async {
await models.sockets.setRover(RoverType.rover);
},
);

register(
ShortcutKey(
[LogicalKeyboardKey.keyK],
modifiers: [KeyModifier.control, KeyModifier.shift],
identifier: "connect to local",
),
callback: () async {
await models.sockets.setRover(RoverType.localhost);
},
);

register(
ShortcutKey(
[LogicalKeyboardKey.keyN],
modifiers: [KeyModifier.control],
identifier: "reset network",
),
callback: () async {
models.home.setMessage(
severity: Severity.info,
text: "Resetting network",
);
await models.sockets.reset();
},
);
HardwareKeyboard.instance.addHandler(_handleRawKeyEvent);
}

Expand Down

0 comments on commit 028ea60

Please sign in to comment.