-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the look of the keyboard settings tab (#20595)
* First cut of new keyboard shortcuts Signed-off-by: Šimon Brandner <[email protected]> * i18n Signed-off-by: Šimon Brandner <[email protected]>
- Loading branch information
1 parent
06fa4f4
commit 03e776d
Showing
2 changed files
with
36 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ | |
"Dismiss": "Dismiss", | ||
"Switch to space by number": "Switch to space by number", | ||
"Open user settings": "Open user settings", | ||
"Previous/next recently visited room or community": "Previous/next recently visited room or community", | ||
"Previous recently visited room or community": "Previous recently visited room or community", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
SimonBrandner
Author
Contributor
|
||
"Next recently visited room or community": "Next recently visited room or community", | ||
"%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)", | ||
"Go to your browser to complete Sign In": "Go to your browser to complete Sign In", | ||
"Unknown device": "Unknown device", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ Copyright 2016 Aviral Dasgupta | |
Copyright 2016 OpenMarket Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Copyright 2018 - 2021 New Vector Ltd | ||
Copyright 2022 Šimon Brandner <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -34,10 +35,8 @@ import Modal from "matrix-react-sdk/src/Modal"; | |
import InfoDialog from "matrix-react-sdk/src/components/views/dialogs/InfoDialog"; | ||
import Spinner from "matrix-react-sdk/src/components/views/elements/Spinner"; | ||
import { | ||
Categories, | ||
CMD_OR_CTRL, | ||
CategoryName, | ||
DIGITS, | ||
Modifiers, | ||
registerShortcut, | ||
} from "matrix-react-sdk/src/accessibility/KeyboardShortcuts"; | ||
import { isOnlyCtrlOrCmdKeyEvent, Key } from "matrix-react-sdk/src/Keyboard"; | ||
|
@@ -287,43 +286,50 @@ export default class ElectronPlatform extends VectorBasePlatform { | |
}); | ||
|
||
// register OS-specific shortcuts | ||
registerShortcut(Categories.NAVIGATION, { | ||
keybinds: [{ | ||
modifiers: [CMD_OR_CTRL], | ||
registerShortcut("KeyBinding.switchToSpaceByNumber", CategoryName.NAVIGATION, { | ||
default: { | ||
ctrlOrCmdKey: true, | ||
key: DIGITS, | ||
}], | ||
description: _td("Switch to space by number"), | ||
}, | ||
displayName: _td("Switch to space by number"), | ||
}); | ||
|
||
if (isMac) { | ||
registerShortcut(Categories.NAVIGATION, { | ||
keybinds: [{ | ||
modifiers: [Modifiers.COMMAND], | ||
registerShortcut("KeyBinding.openUserSettings", CategoryName.NAVIGATION, { | ||
default: { | ||
commandKey: true, | ||
key: Key.COMMA, | ||
}], | ||
description: _td("Open user settings"), | ||
}, | ||
displayName: _td("Open user settings"), | ||
}); | ||
|
||
registerShortcut(Categories.NAVIGATION, { | ||
keybinds: [{ | ||
modifiers: [Modifiers.COMMAND], | ||
registerShortcut("KeyBinding.previousVisitedRoomOrCommunity", CategoryName.NAVIGATION, { | ||
default: { | ||
commandKey: true, | ||
key: Key.SQUARE_BRACKET_LEFT, | ||
}, { | ||
modifiers: [Modifiers.COMMAND], | ||
}, | ||
displayName: _td("Previous recently visited room or community"), | ||
}); | ||
registerShortcut("KeyBinding.nextVisitedRoomOrCommunity", CategoryName.NAVIGATION, { | ||
default: { | ||
commandKey: true, | ||
key: Key.SQUARE_BRACKET_RIGHT, | ||
}], | ||
description: _td("Previous/next recently visited room or community"), | ||
}, | ||
displayName: _td("Next recently visited room or community"), | ||
}); | ||
} else { | ||
registerShortcut(Categories.NAVIGATION, { | ||
keybinds: [{ | ||
modifiers: [Modifiers.ALT], | ||
registerShortcut("KeyBinding.previousVisitedRoomOrCommunity", CategoryName.NAVIGATION, { | ||
default: { | ||
altKey: true, | ||
key: Key.ARROW_LEFT, | ||
}, { | ||
modifiers: [Modifiers.ALT], | ||
}, | ||
displayName: _td("Previous recently visited room or community"), | ||
}); | ||
registerShortcut("KeyBinding.nextVisitedRoomOrCommunity", CategoryName.NAVIGATION, { | ||
default: { | ||
altKey: true, | ||
key: Key.ARROW_RIGHT, | ||
}], | ||
description: _td("Previous/next recently visited room or community"), | ||
}, | ||
displayName: _td("Next recently visited room or community"), | ||
}); | ||
} | ||
|
||
|
@SimonBrandner Sorry for the ping, but is it intentionally "Community" instead of Spaces?