aurora1f888d7
aurora: ctrl+hjkl navigation in the glyph picker
+10 −2
1 file changed
| @@ -5,7 +5,7 @@ import Quickshell.Wayland | |||
| 5 | 5 | import Quickshell.Hyprland | |
| 6 | 6 | ||
| 7 | 7 | // Glyph picker (SUPER+grave, `chars` IPC): emoji, nerd font glyphs, unicode symbols, kaomoji, fancy text. | |
| 8 | − | // Type to fuzzy search; arrows move, Tab section, Ctrl+Left/Right group, Enter copies, Shift+Enter types it | |
| 8 | + | // Type to fuzzy search; arrows / Ctrl+HJKL move, Tab section, Ctrl+Left/Right group, Enter copies, Shift+Enter types it | |
| 9 | 9 | // into the focused window, Ctrl+Enter collects into a buffer, Alt+Enter copies the codepoint. | |
| 10 | 10 | PanelWindow { | |
| 11 | 11 | id: win | |
| @@ -205,6 +205,14 @@ PanelWindow { | |||
| 205 | 205 | Keys.onEscapePressed: win.closeRequested() | |
| 206 | 206 | Keys.onPressed: event => { | |
| 207 | 207 | var k = event.key, m = event.modifiers | |
| 208 | + | // ctrl+h/j/k/l move through the results like the arrows | |
| 209 | + | var vim = { [Qt.Key_H]: Qt.Key_Left, [Qt.Key_J]: Qt.Key_Down, [Qt.Key_K]: Qt.Key_Up, [Qt.Key_L]: Qt.Key_Right } | |
| 210 | + | if ((m & Qt.ControlModifier) && vim[k] !== undefined) { | |
| 211 | + | win.hovered = null | |
| 212 | + | win.move(vim[k]) | |
| 213 | + | event.accepted = true | |
| 214 | + | return | |
| 215 | + | } | |
| 208 | 216 | if (k === Qt.Key_Return || k === Qt.Key_Enter) { | |
| 209 | 217 | if (debounce.running) { debounce.stop(); win.recompute() } | |
| 210 | 218 | var it = win.results[win.view.currentIndex] | |
| @@ -580,7 +588,7 @@ PanelWindow { | |||
| 580 | 588 | Text { | |
| 581 | 589 | Layout.fillWidth: true | |
| 582 | 590 | text: "enter copy " + (Chars.hasWtype ? "shift+enter type " : "") + "ctrl+enter collect alt+enter code " | |
| 583 | − | + "tab section ctrl+arrows group esc close" | |
| 591 | + | + "ctrl+hjkl move tab section ctrl+arrows group esc close" | |
| 584 | 592 | elide: Text.ElideRight | |
| 585 | 593 | color: Theme.dim | |
| 586 | 594 | font.family: Theme.font | |