ijprest / keyboard-layout-editor

Web application to enable the design & editing of keyboard layouts
http://www.keyboard-layout-editor.com/
Other
1.3k stars 240 forks source link

Add keyboard count for motion and size operations #53

Open datatravelandexperiments opened 10 years ago

datatravelandexperiments commented 10 years ago

I've experimentally implemented the keyboard operations described below, to speed up moving and sizing keys. (No pull request since it's unpolished — in particular missing display feedback — but I'll attach an as-is patch: https://gist.github.com/datatravelandexperiments/8042259 . I can also point you to a private running copy to try quickly.)

The user can type a number and optional unit that will be used as
a value by certain following commands.

  0 - 9 .     - value
  u           - standard key size (1u = ¾″)
  i           - inches
  m           - millimetres (doubling this as ‘mm’ is also accepted)
  ,           - retrieve previous value

For the movement and size commands (←↓↑→ and shifted ←↓↑→), a value
without a unit is interpreted as a number of ¼u steps; that is, like
a repeat count of the operation. For instance, “2→” moves the selected
keys 2 steps to the right (one half unit), while “2u→” moves the keys
two units to the right.

Additional shortcuts:

  x           - set the selected key(s) X position
  y           - set the selected key(s) Y position
  w           - set the selected key(s) width
  h           - set the selected key(s) height

For these shortcuts, a value without a unit is taken to be in key sizes,
(same as entered in the input box); so “2w” and “2uw” and “1.5iw” all
set the selected keys to be 1.5 inches wide.

Commands that use the count reset it; for example “2→↑” moves the key
two steps to the right and one step up. The comma “,” shortcut retrieves
the last used count; for example “2→,↑” moves the key two steps right
and two steps up.

TO DO:
- display the current count somewhere! (and indicate whether it is valid)
- backspace to edit the count
- accept EE-style embedded units, e.g. “2u5” = “2.5u”
- more shortcuts, e.g. shift-W for secondary width
jasonm23 commented 9 years ago

Do you have this as a branch on your fork?

iandoug commented 9 years ago

The basics of setting a move or size step can now be done via the Options dialogue. A rather different interface to your proposal, but the end result is effectively the same.

jasonm23 commented 9 years ago

Using the options dialog is very inconvenient though

jasonm23 commented 9 years ago

I think a more simplistic keyboard interface is preferable though.

Eg. C-n (1-9) to set both axis at 0.25u * n

A small toast style notification can display the current.

C-0 can set back to the 0.25 default