lehitoskin/ivy

Hit Escape or something to return focus to image navigation.

Closed this issue · 7 comments

Most other things in Ivy have both mouse and keyboard controls. But currently the only way to return focus to the images for navigation is to click with the mouse. I think hitting Esc or something like that would be appropriate.

This is on my list of things to look into actually. My proposal, when you hit ESC in the tag field:

  • if you have entered or deleted any characters since the last save, your edits are reverted, cursor placed at end of previous tag list.
  • else tag field is de-focussed.

This is analogous to a change I made with PR #12, where hitting ENTER while navigating around focuses the tag field for easy editing.

That may require creating a custom text-field% class where pressing ESCAPE will do what needs to happen. By default, a text-field%'s on-char will return 'text-field-enter when ENTER is pressed and 'text-field for everything else.

So there's no way to know that ESC was hit, because it doesn't modify the text?

Correct. I can probably do this part, doesn't seem too difficult.

@lehitoskin You want to create that text-field% replacement on a branch, and make a pull request for me against my feature branch btoskin/escape-key?

Sounds like a plan

Resolved by d96b1bd