Skip to content

[Discussion] Keyboard shortcuts across devices and operating systems #399

Description

@cguedes

Introduction

RefStudio has multiple keyboard shortcuts for it's operation. They can be organised in three main categories:

  1. File and Project - to create and save files for example; ...
  2. Editor - to make text bold; copy/paste; ...
  3. Utilities & Productivity - to toggle between side panels; open settings; display references; ...

They are also configured differently depending on the hosting environment for the application:

  • Desktop, via Tauri
  • Web, via http server and browser

We also know that the application, and shortcuts, can/should vary depending on the operating system or browser

  • OSX, where is common to use cmd+<key> for actions
  • Windows, where is instead common to use ctrl+<key> for actions

Configuration

Desktop

Most shortcuts, for desktop, are configured via Tauri menu, and these are generally configured to be os agnostic by using cmdOrControl+<key> (for example cmdOrControl+N or cmdOrControl+S.

Note that not all shortcuts are configured via Tauri menu, like the command palette shortcut cmd+k or the quick files shortcut cmd+p.

Web

The web deployment don't include the Tauri menu so we need to add custom code to handle these actions.

Browser restrictions, don't allow to override some of the Tauri menu shortcuts (ex: cmd+n can't be override), so we need to adjust when needed to use a different key binding.

Shortcuts matrix

Action Menu entry Desktop Shortcut Browser Shortcut Comment
Toggle settings Refstudio -> Settings cmdOrControl+, meta+, won't work for windows in the browser
Hide RefStudio Refstudio -> Hide refstudio (native) (none) native action in Desktop
Hide others Refstudio -> Hide Others (native) (none) native action in Desktop
Quit Refstudio Refstudio -> Quit (native) (none) native action in Desktop
New File File -> New File cmdOrControl+N ctrl+n meta+n can't be override. Not sure if is the correct shortcut for windows
Save File File -> Save cmdOrControl+S meta+s | ctrl+s meta+s can be override. ctrl+s is also configured for Windows (and to match ctrl+n)
Close Editor File -> Close Editor cmdOrControl+W ctrl+w meta+n can't be override. Not sure if is the correct shortcut for windows
Text edit actions Edit -> ... (native) (native) native action in desktop and web
Open References References -> Open cmdOrControl+R meta+r meta+r can be override (if pressed again with refresh the page). Not sure if is the correct shortcut.
Toggle notifications View -> Notifications F11 F11  
Utilities & Productivity        
Toggle Panel - Explorer (none) cmd+1 cmd+1  won't work in windows
Toggle Panel - References (none) cmd+2 cmd+2  won't work in windows
Toggle Panel - Rewriter (none) cmd+9 cmd+9  won't work in windows
Toggle Panel - Chatbot (none) cmd+0 cmd+0  won't work in windows
Show Command Palette (none) cmd+k cmd+k  won't work in windows
Show Quick Files (none) cmd+p cmd+p cmd+p can be override in browser. Usually for print. won't work in windows

This is a follow-up issue of #387 and #388.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions