emgram769 / lighthouse

A simple scriptable popup dialog to run on X.
MIT License
633 stars 31 forks source link

Shortcut to set input = currently selected output item #74

Open 0ion9 opened 9 years ago

0ion9 commented 9 years ago

(command would be analogous to Tab Copy the selected item to the input field. command found in dmenu.)

This is useful when input is complex or when you want to make a selection but then refine it by further typing.

For example, I have an eagerly-completing tmsu tagging script for lighthouse -- I type tag fragments and the script matches them to the best candidate tag name, and also shows other candidates. Currently, selecting other candidates with up/down arrows is not very useful, as you then have to press Enter to finalize the selection, which terminates Lighthouse rather than allowing you to continue refining your selection.

I can probably work up an implementation of this pretty easily. I see we are already using Tab and Shift+Tab -- could we bind this to Control-Tab, or would something else be better?

(Interestingly, Control+Tab currently causes the same behaviour as Tab, even though there is no case for Control+Tab listed in lighthouse.c:process_key_stroke(); is that a bug?)

emgram769 commented 8 years ago

an alternative to tab complete from selections would be the ability for the script to provide specific tab completes. for example "light" might be a valid query where the first result would be something that turns on the keyboard light, but [tab] might complete to "lighthouse." I'd imagine this would be shown as suggested text like this (note dave is the suggestion but Dave is the first result)

suggested text

emgram769 commented 8 years ago

control + tab is likely a bug