Use physical keys+layout for shortcuts
This commit is contained in:
parent
b6cfe0933d
commit
3e31a7405b
5 changed files with 50 additions and 6 deletions
|
@ -32,6 +32,7 @@ import { filter } from './util/iterables';
|
|||
import { isNotNil } from './util/isNotNil';
|
||||
import { senderCertificateService } from './services/senderCertificate';
|
||||
import { GROUP_CREDENTIALS_KEY } from './services/groupCredentialFetcher';
|
||||
import * as KeyboardLayout from './services/keyboardLayout';
|
||||
import { routineProfileRefresh } from './routineProfileRefresh';
|
||||
import { isMoreRecentThan, isOlderThan, toDayMillis } from './util/timestamp';
|
||||
import { isValidReactionEmoji } from './reactions/isValidReactionEmoji';
|
||||
|
@ -142,6 +143,8 @@ export async function cleanupSessionResets(): Promise<void> {
|
|||
}
|
||||
|
||||
export async function startApp(): Promise<void> {
|
||||
await KeyboardLayout.initialize();
|
||||
|
||||
window.Whisper.events = window._.clone(window.Backbone.Events);
|
||||
window.Signal.Util.MessageController.install();
|
||||
window.Signal.conversationControllerStart();
|
||||
|
@ -1145,7 +1148,7 @@ export async function startApp(): Promise<void> {
|
|||
};
|
||||
|
||||
document.addEventListener('keydown', event => {
|
||||
const { ctrlKey, key, metaKey, shiftKey } = event;
|
||||
const { ctrlKey, metaKey, shiftKey } = event;
|
||||
|
||||
const commandKey = window.platform === 'darwin' && metaKey;
|
||||
const controlKey = window.platform !== 'darwin' && ctrlKey;
|
||||
|
@ -1155,6 +1158,8 @@ export async function startApp(): Promise<void> {
|
|||
const selectedId = state.conversations.selectedConversationId;
|
||||
const conversation = window.ConversationController.get(selectedId);
|
||||
|
||||
const key = KeyboardLayout.lookup(event);
|
||||
|
||||
// NAVIGATION
|
||||
|
||||
// Show keyboard shortcuts - handled by Electron-managed keyboard shortcuts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue