googlefonts / fontra

A browser-based font editor
https://fontra.xyz
GNU General Public License v3.0
510 stars 21 forks source link

Specify keyboard shortcuts for tools #1589

Closed ollimeier closed 1 month ago

ollimeier commented 3 months ago

Currently the 'main' tools keyboard shortcuts go from 1 to 6. But whenever a new tool gets added the shortcuts may change depending on its position, therefore the users requested unique keyboard shortcuts which should be ideally be customizable.

ollimeier commented 3 months ago

Let's start with comparing shortscuts with other apps first:

RoboFont: Editing Tool: 1 (equivalent to Fontras Pointer) Drawing Tool: 2 (equivalent to Fontras Pen) Slice Tool: 3 (equivalent to Fontras Knife) Measurement: 4 (equivalent to Fontras Power Ruler) Draw Geometric shapes tool: 5 (equivalent to Fontras Shapes)

Glyphsapp: Select: V (equivalent to Fontras Pointer) Draw: P (equivalent to Fontras Pen) Knife: E (equivalent to Fontras Knife) Pencil: B Primitives: F (equivalent to Fontras Shapes) Rotate: R (equivalent to Fontras Transformation panel tools) Scale: S (equivalent to Fontras Transformation panel tools) Text: T Annotation: A (maybe equivalent to Fontras 'Glyph Note' panel) Hand: H (equivalent to Fontras Hand) Zoom: Z (almost equivalent to Fontras zoom tools plus, minus, fit) Measurement: L (equivalent to Fontras Power Ruler) TrueType Instructions: I

Figma: https://bootcamp.uxdesign.cc/awesome-figma-keyboard-shortcuts-d37836562a8b#d3ca Frame tool: F Pen tool: P Pencil Tool: Shift + P Rectangle tool: R Slice tool: S Line tool: L Ellipse tool: O Arrow tool: Shift + L Comment tool: C Hand tool: H

Affinity: https://forum.affinity.serif.com/index.php?/topic/165883-tools-shortcuts-in-affinity-photo-on-windows-10-require-holding-enter-instead-of-shift/&do=findComment&comment=945862 Flood Fill Tool / Gradient cycle: G View Tool: H Move Tool: V Colour Picker Tool: I Crop Tool: C Selection Tools cycle: W Pen and Node Tool cycle: P Zoom Tool: Z Clone Tool: S Shape Tools cycle: U Text Tools cycle: T Dodge, Burn and Sponge Brush Tool cycle: O Retouch Tools cycle: J Painting Tools cycle: B Erase Tools cycle: E Marquee Selection Tools cycle: M Freehand Selection Tool: L

Adobe InDesign: https://helpx.adobe.com/indesign/using/default-keyboard-shortcuts.html

Selection tool: V, Esc Direct Selection tool: A Toggle Selection and Direct Selection tool: Command+Control+Tab Page tool: Shift+P Gap tool: U Pen tool: P Add Anchor Point tool: = Add Anchor Point tool: Delete Anchor Point tool: - Delete Anchor Point tool: - Convert Direction Point tool: Shift+C Type tool: T Type On A Path tool: Shift+T Pencil tool (Note tool): N Line tool: \ Rectangle Frame tool: F Rectangle tool: M Ellipse tool: L Rotate tool: R Scale tool: S Shear tool: O Free Transform tool: E Eyedropper tool: I Measure tool: K Gradient tool: G Scissors tool: C Hand tool: H Temporarily selects Hand tool: Spacebar (Layout mode), Option (Text mode), or Option+Spacebar (both) Zoom tool: Z Temporarily selects Zoom In tool: Command+Spacebar Toggle Fill and Stroke: X Swap Fill and Stroke: Shift+X Toggle between Formatting Affects Container and Formatting Affects Text: J Apply Color: , [comma] Apply Gradient: . [period] Apply No Color: / Switch between Normal View and Preview Mode: W Frame Grid tool (horizontal): Y Frame Grid tool (vertical): Q Gradient Feather tool: Shift+G

Adobe Illustrator: https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html#keys_for_selecting_tools Artboard tool: Shift + O Selection tool: V Direct Selection tool: A Magic Wand tool: Y Lasso tool: Q Pen tool: P Curvature tool: Shift + ~ Blob Brush tool: Shift + B Add Anchor Point tool: + (plus) Delete Anchor Point tool: - (minus) Switch to Anchor Point tool: Shift + C Type tool: T Touch Type tool: Shift + T Line Segment tool: \ (backslash) Rectangle tool: M Ellipse tool: L Paintbrush tool: B Pencil tool: N Shaper tool: Shift + N Rotate tool: R Reflect tool: O Scale tool: S Warp tool: Shift + R Width Tool: Shift+W Free Transform tool: E Shape Builder Tool: Shift+M Perspective Grid Tool: Shift+P Perspective Selection Tool: Shift+V Symbol Sprayer tool: Shift + S Column Graph tool: J Mesh tool: U Gradient tool: G Eyedropper tool: I Blend tool: W Live Paint Bucket tool: K Live Paint Selection tool: Shift + L Slice tool: Shift + K Eraser tool: Shift + E Scissors tool: C Hand tool: H Zoom tool: Z Switch to Smooth tool while using Blob Brush tool: Press Option

ollimeier commented 3 months ago

@justvanrossum @BlackFoundry What do you think about the following? Any concerns or suggestions?

Based on the above, I can imagine the following for Fontra:

Pointer Tool: V (similar to Glyphsapp and InDesign) Pen Tool: P (for Pen, similar to all other apps) Knife Tool: S (for Slice, similar to Figma) Shape Tool: R (for Rectangle), O (for Ellipse) => both similar to Figma Power Ruler: M (for measurement) Handtool Tool: H (for Hand, similar to all other apps)

For future we also should keep in mind: Text Tool: T

justvanrossum commented 3 months ago

TBH I don't think this is the right discussion at the moment. The task we need to focus on is to allow users to configure any shortcut they want for any functionality we can reasonably hook up.

ollimeier commented 3 months ago

@justvanrossum I am with you. My initial thought with this was just to come up with a fast solution, before we make the heavy work with making it customizable (as suggested here): https://github.com/googlefonts/fontra/issues/1587

Here is a possible quick solution: https://github.com/googlefonts/fontra/pull/1592