dots-hyprland icon indicating copy to clipboard operation
dots-hyprland copied to clipboard

Add a set of common keybinds to launcher widget

Open clsty opened this issue 1 year ago • 4 comments

What would you like to be added?

For the launcher widget (which keybinding is Super), add following keybindings:

  • Ctrl+N: Select next item (same as Down arrow key).
  • Ctrl+P: Select previous item (same as Up arrow key).
  • Ctrl+F: Cursor move forward (same as Right arrow key).
  • Ctrl+B: Cursor move backward (same as Left arrow key).
  • Ctrl+A: Cursor moves to begin of line (same as Home key).
  • Ctrl+E: Cursor moves to end of line (same as End key).
  • Ctrl+U: Deletes from "begin of line" to cursor. (Already supported actually)
  • Ctrl+K: Deletes from cursor to "end of line".

How will it help

1. Consistency and Routine

Such keybinds are widely used in Linux.

Here're some examples:

Shells

  • Example programs: Bash, Zsh, Fish
    • Behavior: Ctrl+N/P/F/B equals to Down/Up/Right/Left arrow keys, Ctrl+A/E moves to begin/end of line, Ctrl+U/K deletes between cursor and begin/end of line.

Editors

  • Example program: Emacs

    • Behavior: Ctrl+N/P/F/B equals to Down/Up/Right/Left arrow keys, Ctrl+A/E moves to begin/end of line, Ctrl+K deletes between cursor and end of line (Ctrl+U binds to another function though).
  • Example program: Nano

    • Behavior: Ctrl+N/P/F/B equals to Down/Up/Right/Left arrow keys, Ctrl+A/E moves to begin/end of line (Ctrl+U/K binds to another function though).

Launchers

  • Example program: Rofi
    • Behavior: Ctrl+N/P/F/B equals to Down/Up/Right/Left arrow keys, Ctrl+A/E moves to begin/end of line, Ctrl+U/K deletes between cursor and begin/end of line.
  • Example program: Fuzzel
    • Behavior: Ctrl+N/P/F/B equals to Down/Up/Right/Left arrow keys, Ctrl+A/E moves to begin/end of line, Ctrl+K deletes between cursor and end of line (Ctrl+U is not implemented though).

More

You may find these keybindings somewhere usable (and useful!) at more places, e.g. you may Ctrl+U when you input a wrong password, clear it in real quick and then input again.

2. Handy and efficient

Unlike these keybindings above, the original Down/Up/Right/Left arrow keys locates on the right-bottom corner, which is far from the center of type area (i.e. character keys A/S/D/F for the left hand, J/K/L/; for the right hand). Therefore, to press those keys, the whole right arm (not just fingers) must move a distance, which cost a second or two (and to precisely press the key instead of the keys nearby, it's even slower). Also it's not very comfortable when wrist float in the air.

Similarly for Home/End keys, which are even farther.

3. No harm

This will not affect the people who do not use such keybinds.

clsty avatar Feb 12 '24 03:02 clsty

sure i can do that though it sounds awkward as hell. i thought vim keybindings were something, and here's something else...

end-4 avatar Feb 12 '24 07:02 end-4

sure i can do that

Many thanks! I'd love this feature long time ago. Currently I'm using fuzzel as workaround, which means I can't enjoy the launcher on AGS.

though it sounds awkward as hell. i thought vim keybindings were something, and here's something else...

Yeah, they're different things. vim-like keybindings is mainly for window/workspace managing, and the keybindings here is mainly for the situation when there is a text input-box with a cursor blinking inside.

clsty avatar Feb 12 '24 08:02 clsty

  • I realized Ctrl A already selects All text. hmm....
  • Still figuring out a clean way to have ctrl n/p for up/down

end-4 avatar Feb 13 '24 14:02 end-4

Actually I mainly want ctrl n/p because I really use them often.

Other keybinds are both ok for me to or not to implement.

clsty avatar Feb 16 '24 23:02 clsty