elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.21k stars 379 forks source link

Keyboard selection of event boxes. #1115

Open KaitlynEthylia opened 3 months ago

KaitlynEthylia commented 3 months ago

Description of the requested feature

It would be nice if, when a window is focused, it were possible to use the arrow keys to "hover" over event boxes, or return to "click" them

Proposed configuration syntax

(eventbox :keyboard-selectable true (...))

Additional context

No response

ancion commented 1 month ago

This would be useful with Tab key to select a Item in Task View or Launcher View image image

w-lfchen commented 1 month ago

will be partially addressed by #640, if the author responds. i'll supersede that pr with a new one if that doesn't happen.

from my experience, tab functionality is sometimes there due to gtk doing gtk things, i imagine implementing arrow keys to be somewhat difficult.

for example, how should the relation between widget locations be resolved?

there are handlers for keyboard events though, so i wouldn't completely rule out the possibility of implementing such functionality

w-lfchen commented 1 month ago

hi, i've looked into this further while working on #1187 (implements keyboard support for buttons). while i am not experienced enough to make any claims with full confidence, it seems like eventboxes are not able to receive button press events . also, some things were really flaky, but it's entirely possible that i just missed something or that my code sucks, gtk is hard ^^'

however, i can report something else: keyboard navigation (using arrow keys and tab) works, at least from a small test with an array of buttons inside boxes. since buttons can hold any widget as their child, just use those instead of eventboxes if possible

if you want to help out a bit, feel free to build and use #1187 and report your experiences there ^^ if you think that pr resolves this issue, feel free to mention it there so i can link the two