Some keyboard shortcut tweaks for macOS

This commit is contained in:
Veronica K. B. Olsen
2019-11-05 10:38:44 +01:00
parent 9b48c07e0b
commit 28d347c848
2 changed files with 22 additions and 8 deletions
+10 -5
View File
@@ -68,9 +68,10 @@ These are as following:
":kbd:`Ctrl-B`", "Format selected text, or word under cursor, as bold."
":kbd:`Ctrl-C`", "Copy selected text to clipboard."
":kbd:`Ctrl-D`", "Wrap selected text, or word under cursor, in double quotes."
":kbd:`Ctrl-E`", "If in tree view, edit a document or folder settings."
":kbd:`Ctrl-E`", "If in tree view, edit a document or folder settings. (Same as :kbd:`F2`)"
":kbd:`Ctrl-F`", "Open the search bar and search for selected word, if any is selected."
":kbd:`Ctrl-H`", "Open the search and replace bar and search for selected word, if any is selected."
":kbd:`Ctrl-G`", "Find next occurrence of word in current document. (Same as :kbd:`F3`)"
":kbd:`Ctrl-H`", "Open the search and replace bar and search for selected word, if any is selected. (On Mac, this is :kbd:`Cmd+=`)"
":kbd:`Ctrl-I`", "Format selected text, or word under cursor, as italic."
":kbd:`Ctrl-N`", "Create new document."
":kbd:`Ctrl-O`", "Open selected document."
@@ -91,6 +92,7 @@ These are as following:
":kbd:`Ctrl-Shift-1`", "Replace occurrence of word in current document, and search for next occurrence."
":kbd:`Ctrl-Shift-A`", "Select all text in current paragraph."
":kbd:`Ctrl-Shift-D`", "Wrap selected text, or word under cursor, in single quotes."
":kbd:`Ctrl-Shift+G`", "Find previous occurrence of word in current document. (Same as :kbd:`Shift-F3`"
":kbd:`Ctrl-Shift-I`", "Import text to the current document from a text file."
":kbd:`Ctrl-Shift-N`", "Create new folder."
":kbd:`Ctrl-Shift-O`", "Open a project."
@@ -100,12 +102,15 @@ These are as following:
":kbd:`Ctrl-Shift-Up`", "Move item one step up in the tree view."
":kbd:`Ctrl-Shift-Down`", "Move item one step down in the tree view."
":kbd:`F1`", "Open documentation."
":kbd:`F2`", "Alternative to :kbd:`Ctrl-E`."
":kbd:`F3`", "Find next occurrence of word in current document."
":kbd:`F2`", "If in tree view, edit a document or folder settings. (Same as :kbd:`Ctrl-E`)"
":kbd:`F3`", "Find next occurrence of word in current document. (Same as :kbd:`Ctrl-G`)"
":kbd:`F5`", "Export project dialog."
":kbd:`F7`", "Re-run spell checker."
":kbd:`F9`", "Re-build project indices."
":kbd:`Shift-Enter`", "Insert a hard line break at the cursor position."
":kbd:`Shift-F3`", "Find previous occurrence of word in current document."
":kbd:`Shift-F3`", "Find previous occurrence of word in current document. (Same as :kbd:`Ctrl-Shift-G`"
":kbd:`Shift-Space`", "Insert a non-breaking space at the cursor position."
":kbd:`Enter`", "If in tree view, open a document for editing."
.. note::
On macOS, replace :kbd:`Ctrl` with :kbd:`Cmd`.
+12 -3
View File
@@ -475,21 +475,30 @@ class GuiMainMenu(QMenuBar):
# Edit > Replace
menuItem = QAction("Replace", self)
menuItem.setStatusTip("Replace text in document")
menuItem.setShortcut("Ctrl+H")
if self.mainConf.osDarwin:
menuItem.setShortcut("Ctrl+=")
else:
menuItem.setShortcut("Ctrl+H")
menuItem.triggered.connect(lambda: self._docAction(nwDocAction.REPLACE))
self.editMenu.addAction(menuItem)
# Edit > Find Next
menuItem = QAction("Find Next", self)
menuItem.setStatusTip("Find next occurrence text in document")
menuItem.setShortcut("F3")
if self.mainConf.osDarwin:
menuItem.setShortcuts(["Ctrl+G","F3"])
else:
menuItem.setShortcuts(["F3","Ctrl+G"])
menuItem.triggered.connect(lambda: self._docAction(nwDocAction.GO_NEXT))
self.editMenu.addAction(menuItem)
# Edit > Find Prev
menuItem = QAction("Find Previous", self)
menuItem.setStatusTip("Find previous occurrence text in document")
menuItem.setShortcut("Shift+F3")
if self.mainConf.osDarwin:
menuItem.setShortcuts(["Ctrl+Shift+G","Shift+F3"])
else:
menuItem.setShortcuts(["Shift+F3","Ctrl+Shift+G"])
menuItem.triggered.connect(lambda: self._docAction(nwDocAction.GO_PREV))
self.editMenu.addAction(menuItem)