-
Notifications
You must be signed in to change notification settings - Fork 245
Design: mouse support compatibility
The way Cursive will model mouse events depends on the way the various backends handle it:
Termion can return a MouseEvent
which can be Press
, Release
or Hold
, each time with the mouse position as (u16, u16)
. Only the Press
event indicates the button itself, but we can easily remember the last button pressed when sending Release
events. Currently no modifiers support apparently (CTRL/ALT/SHIFT).
ncurses can detect when a mouse button is clicked (quickly pressed + released), double-clicked, or triple-clicked, for 5 mouse buttons. Looks like it can detect modifiers, but I haven't tested that yet. I suppose pancurses does the same.
BearLibTerminal can apparently detect Mouse move, scroll (wheel movement, with a i32
), as well as Press/Release events of 5 buttons. It also supports ctrl/shift modifiers, as it does for every other keys.
Press/Release events don't include the position, so we'll need to save it from the last MouseMove event.