From 373fb49903f8eb49d24a70c67693295235e9219d Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Tue, 9 Jan 2024 20:53:16 -0500 Subject: [PATCH] Fix some keyboard shortcuts on macOS that involved arrow keys --- resources/qml/MessageInput.qml | 4 ++-- resources/qml/MessageView.qml | 6 +++--- resources/qml/Root.qml | 4 ++-- resources/qml/TimelineView.qml | 2 +- resources/qml/dialogs/InputDialog.qml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index 37793751..ffe80a2e 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -224,7 +224,7 @@ Rectangle { } else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Backtab) && popup.opened) { event.accepted = true; completer.down(); - } else if (event.key == Qt.Key_Up && event.modifiers == Qt.NoModifier) { + } else if (event.key == Qt.Key_Up && (event.modifiers == Qt.NoModifier || event.modifiers == Qt.KeypadModifier)) { if (cursorPosition == 0) { event.accepted = true; var idx = room.edit ? room.idToIndex(room.edit) + 1 : 0; @@ -242,7 +242,7 @@ Rectangle { event.accepted = true; positionCursorAtStart(); } - } else if (event.key == Qt.Key_Down && event.modifiers == Qt.NoModifier) { + } else if (event.key == Qt.Key_Down && (event.modifiers == Qt.NoModifier || event.modifiers == Qt.KeypadModifier)) { if (cursorPosition == messageInput.length && room.edit) { event.accepted = true; var idx = room.idToIndex(room.edit) - 1; diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index 97a121eb..c2dd8308 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -283,7 +283,7 @@ Item { } } Shortcut { - sequence: StandardKey.MoveToPreviousPage + sequences: [StandardKey.MoveToPreviousPage] onActivated: { chat.contentY = chat.contentY - chat.height * 0.9; @@ -291,7 +291,7 @@ Item { } } Shortcut { - sequence: StandardKey.MoveToNextPage + sequences: [StandardKey.MoveToNextPage] onActivated: { chat.contentY = chat.contentY + chat.height * 0.9; @@ -299,7 +299,7 @@ Item { } } Shortcut { - sequence: StandardKey.Cancel + sequences: [StandardKey.Cancel] onActivated: { if (room.input.uploads.length > 0) diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml index 4acf3e73..8145e5e5 100644 --- a/resources/qml/Root.qml +++ b/resources/qml/Root.qml @@ -127,12 +127,12 @@ Pane { onActivated: Rooms.nextRoomWithActivity() } Shortcut { - sequence: "Ctrl+Down" + sequences: ["Ctrl+Down", "Ctrl+PgDown"] onActivated: Rooms.nextRoom() } Shortcut { - sequence: "Ctrl+Up" + sequences: ["Ctrl+Up", "Ctrl+PgUp"] onActivated: Rooms.previousRoom() } diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 0a255491..6786b26b 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -39,7 +39,7 @@ Item { emoji: true } Shortcut { - sequence: StandardKey.Close + sequences: [StandardKey.Close] onActivated: Rooms.resetCurrentRoom() } diff --git a/resources/qml/dialogs/InputDialog.qml b/resources/qml/dialogs/InputDialog.qml index 8bd95d09..bf3cbc9a 100644 --- a/resources/qml/dialogs/InputDialog.qml +++ b/resources/qml/dialogs/InputDialog.qml @@ -25,7 +25,7 @@ ApplicationWindow { } Shortcut { - sequence: StandardKey.Cancel + sequences: [StandardKey.Cancel] onActivated: dbb.rejected() }