Sandbox:Keyboard Shortcuts

= Context =

This page is aiming at refactoring the keyboard shortcuts in FreeCAD. Indeed at the moment, several problems exist such as overlapping, lack of consistency, ... When work is over, this page can be mutated so it serves as a keyboard shortcuts overview.

Discussion in the forum

= Timeline =

Proposed activities are (more or less in chronological order) :
 * List all available commands by workbench
 * Define global guidelines
 * Define new shortcuts to commands (following guidelines)
 * Implement in the code

= Global guidelines =

Proposed guidelines :
 * Use standard shortcuts for standard commands across software (New, Open, Save, Undo/Redo, ...)
 * Shortcuts using 'Ctrl' key should be reserved for global commands
 * Function keys (F1 to F12) should be reserved for global commands
 * Shortcuts using 'Shift' key could be used to indicate an opposite/complementary action (to the one without 'Shift')
 * Shortcuts using 'Alt' key should be avoided (it is used to access menus, and 'Ctrl+Alt' or 'Shift+Alt' are often system shortcuts)
 * Shortcuts using only alpha key (single or combo -- without modifier) should be reserved to workbench local commands
 * Shortcuts using only num key (without modifier) should be avoided (to prevent unwanted actions)
 * Shortcuts using system keys ('PrntScr', 'Pause', ...) should be avoided
 * Most used commands should have a shortcut. Not all commands have to have a shortcut.

= List of commands =
 * "E" means the keyboard key E, not the upper case letter E (aka Shift+e)
 * A shortcut can be a sequence of keystrokes. "E, U" would mean you press and release the E key, then press and release the U key.
 * Sometimes Qt seems to "lock up" and not accept key commands. For example, while in a sketch, if you type "K" to start a measurement constraint, but change your mind and press the standalone hotkey "E" to use "constrain equal", FreeCAD will appear to do nothing. In reality, FreeCAD was still expecting you to complete a "K, " sequence and it identifies "K, E" as an invalid response. This eats your "E" input. Pressing E again will trigger "Constrain Equal" like you'd expect. This can have serious consequences. For example, in Draft, if you accidentally hit F, then repeatedly try to hit "R, O" for rotate, nothing will happen because Qt interprets "F, R" = invalid shortcut, "O, R" = invalid shortcut, "O, R" = invalid (expected O, S = offset), and this can loop forever. You have to hit R twice to break the cycle: "O, R, R, O" translates to "O, R = invalid"; "R, O = Rotate".

FreeCAD shortcut limitations:


 * Shortcuts can be a maximum of 4 characters long. For example, "Shift+E, Ctrl+M, Ctrl+H, Shift+P" is perfectly fine, but "H, M, E, S, R" is too long.
 * Shortcuts cannot end with the, key. You may begin a shortcut with , and it will work. For example, "," works and ",, K" works, but "K, ," will not save correctly.
 * Shift can only be used on letters. Shift does not work with the numrow, with punctuation, or with other symbols. You can record a shortcut like "Shift+$" but you will never be able to trigger it. Holding shift and attempting to use the numpad will temporarily disable numlock (at least on Windows 10), so that's off limits too.

Hidden Global Shortcuts
''These shortcuts are not listed in the Keyboard Customization window. You will not see a warning if one of your shortcuts causes a conflict!''

1. You can switch between workbenches with W, 1 through W, 9. These shortcuts are set automatically when FreeCAD launches. By arranging your workbench list in "Tools->Customize...->Workbenches", then closing and reopening FreeCAD, you can set these shortcuts to your liking. You can check and see these shortcuts in the Menubar's "View->Workbench", but not in the Workbench Dropdown List toolbar.

2. After you click inside the TreeView panel, you can press Ctrl+F to open a search bar. In KDE Linux, you can change the shortcut by opening KDE System Settings and going to Shortcuts->Common Actions->Edit->Find.

3. Std_DrawStyle opens a dropdown menu, making it impossible to change these 7 shortcuts in the GUI:

Customizable shortcuts
Up-to-date for FreeCAD 0.20.1

These global shortcuts do appear in "Tools->Customize...->Keyboard". FreeCAD's GUI lists shortcuts by "Category", but this Wiki page lists shortcuts by "workbench" first. FreeCAD's GUI puts some commands, like "Export Page as SVG" in the file "category", but that command is actually from the TechDraw "Workbench".

Note: In KDE Linux, some FreeCAD shortcuts follow the Common Actions shortcuts found in KDE System Settings. For example, KDE's default Redo is Ctrl+Shift+Z, not Ctrl+Y. If you override the shortcut within FreeCAD, your preference will be remembered even if the KDE shortcut changes. To use KDE's universal shortcuts again, click "Reset" or "Reset All." When FreeCAD launches, it imports KDE's shortcuts, so shortcuts may not seem "up to date" until FreeCAD is restarted. Tested 2022-09-30, Manjaro Linux 5.15, FreeCAD 0.20.1 (flatpak)

Arch Workbench
Up to date for FreeCAD 0.20.1

Draft quirks:
The Draft workbench handles some shortcuts in unique ways.

First, in "Edit -> Preferences -> Draft -> User interface settings", there is a list of "In-Command Shortcuts". These shortcuts are available if a Draft tool is active and the cursor is blinking inside a text box. Regular hotkeys (letter-only keyboard shortcuts) are disabled while a textbox is active, so these shortcuts won't interfere with anything. After text is entered into the text box, In-Command Shortcuts will deactivate and act as regular letter keys. For example, if the user types "sn15 in", S will toggle snapping, the first N activates the "Wipe" command, and the second N will type "n" because it comes after "15 i".

Second, in "Edit -> Preferences -> Draft -> Grid and snapping", there are three "Snapping" modifiers that can be changed by the user. By default, Constrain mod = Shift, Snap mod = Ctrl, and Alt mod = Alt. Notably, these settings do not affect the Dimension (Draft_Dimension) tool. Dimension is always hard-coded to be Shift=Snap, Ctrl=Constrain, and Alt=Angle/edge length.

Third, it is difficult to set shortcuts for Draft Snap commands. See this forum thread for a workaround: https://forum.freecadweb.org/viewtopic.php?t=67658&p=585119

Normal Draft Stuff:
Up to date for FreeCAD 0.20.1

After all of that, here is the normal list of Draft commands and shortcuts.

Drawing Workbench
The Drawing Workbench has been obsolete since 0.17 and exists for compatibility with older files.

FEM Workbench
Up to date for FreeCAD 0.20.1

Note: FEM Workbench shortcuts no longer conflict with one another!

Image Workbench
Up to date for FreeCAD 0.20.1

Inspection Workbench
Up to date for FreeCAD 0.20.1

Mesh Design Workbench
Up to date for FreeCAD 0.20.1...

OpenSCAD Workbench
Up to date for FreeCAD 0.20.1

PartDesign Workbench
Up to date for FreeCAD 0.20.1

Part Workbench
Up to date for FreeCAD 0.20.1

Path Workbench
Up to date for FreeCAD 0.20.1

Points Workbench
Up to date for FreeCAD 0.20.1

Raytracing Workbench
Up to date for FreeCAD 0.20.1

Reverse engineering Workbench
Up to date for FreeCAD 0.20.1

Robot Workbench
Up to date for FreeCAD 0.20.1

Sketcher Workbench
Up to date for FreeCAD 0.20.1

Quirks:

While the Sketcher Polyline tool is active, the M key cycles its behavior. This shortcut cannot be changed.

When editing a sketch, shortcuts from other workbenches and some global shortcuts are ignored. (for example, "A, C" will not toggle Axis cross, but 1, 2, ... 6 still rotates the view.) This is only true while a sketch is being edited, it does not matter if the sketcher workbench is active. The same behavior can be seen whenever a menu is open in the Tasks view, however, the functionality is most useful for Sketcher.

Sketcher shortcuts can never cause conflicts with other workbenches because they are disabled outside of sketch edit mode.

Sketcher shortcut chart
These images show sketcher shortcuts in the shape of your keyboard. This may be convenient as a reference, but some shortcuts could not be included.

Sketcher shortcuts
This list contains all sketcher shortcuts but may be harder to understand.

Spreadsheet Workbench
Up to date for FreeCAD 0.20.1

Quirks:

The edit cell shortcut is F2. This shortcut cannot be changed, even in KDE.

The global workbench's cut/copy/paste shortcuts work in spreadsheet.

Start Workbench
Up to date for FreeCAD 0.20.1

Surface Workbench
Up to date for FreeCAD 0.20.1

TechDraw Workbench
Up to date for FreeCAD 0.20.1

Test Workbench
Up to date for FreeCAD 0.20.1