Skip to content

Commit

Permalink
[auth] Fix key binding for search focus on mac (#4584)
Browse files Browse the repository at this point in the history
## Description

## Tests
  • Loading branch information
ua741 authored Jan 3, 2025
2 parents aea531e + c5019da commit 1952e52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions auth/lib/ui/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,18 @@ class _HomePageState extends State<HomePage> {
bool _handleKeyEvent(KeyEvent event) {
if (event is KeyDownEvent) {
_pressedKeys.add(event.logicalKey);
if ((_pressedKeys.contains(LogicalKeyboardKey.controlLeft) ||
bool isMetaKeyPressed = Platform.isMacOS || Platform.isIOS
? (_pressedKeys.contains(LogicalKeyboardKey.metaLeft) ||
_pressedKeys.contains(LogicalKeyboardKey.meta) ||
_pressedKeys.contains(LogicalKeyboardKey.metaRight))
: (_pressedKeys.contains(LogicalKeyboardKey.controlLeft) ||
_pressedKeys.contains(LogicalKeyboardKey.control) ||
_pressedKeys.contains(LogicalKeyboardKey.controlRight)) &&
event.logicalKey == LogicalKeyboardKey.keyF) {
_pressedKeys.contains(LogicalKeyboardKey.controlRight));

if (isMetaKeyPressed && event.logicalKey == LogicalKeyboardKey.keyF) {
setState(() {
_showSearchBox = true;
searchBoxFocusNode.requestFocus();
_textController.clear();
_searchText = "";
});
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion auth/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 4.2.2+422
version: 4.2.3+423
publish_to: none

environment:
Expand Down

0 comments on commit 1952e52

Please sign in to comment.