yofi icon indicating copy to clipboard operation
yofi copied to clipboard

Navigate with mouse

Open LGFae opened this issue 2 years ago • 1 comments

Currently, the only to navigate in yofi is through the keyboard. This includes both scrolling and selecting an entry. It would be great if one could also scroll and select an entry with the mouse.

My current problem is that I want yofi to pop up when I click something in a taskbar, put then I need to let go of the mouse and type what I want, regardless of whether it's right there on the screen in front of me.

LGFae avatar Apr 21 '22 23:04 LGFae

I also was thinking about this problem (pushed skeleton for mouse support at https://github.com/l4l/yofi/tree/wip-mouse-support) and that's actually not a hard one to implement.

Essentially one need to accurately calculate list item index by y-offset as specified in list_view.rs for each wl_pointer::Event::Motion (though this one is quite hard to grasp) and apparently moving out to some common utility functions. With the offset it's possible to get an entry index (similar to selected_item) and then click (wl_pointer::Event::Button) is close to Enter (aka XKB_KEY_Return) handling.

l4l avatar Apr 22 '22 18:04 l4l