Mouse Support 馃惌 #3416
Replies: 11 comments 4 replies
-
Test CodeHere's some sample code... mouse.php
This shows what the terminal can give us. mouse.c
It tracks the mouse and catches mouse clicks and scrolling. [devel/mouse]
This branch is a Proof-of-concept for mouse support in NeoMutt. |
Beta Was this translation helpful? Give feedback.
-
How it worksI wrote the proof-of-concept nearly two years ago. Quite a lot has changed since then. NeoMutt's windows are nested: See also:
Each dialog's event loop calls
Finally, Refs:
|
Beta Was this translation helpful? Give feedback.
-
EventsWe can start with hard-coded behaviours, e.g. click here means this function. In increasing order of difficulty, the events are: Single ClickThe simplest event is a single left mouse click. We can convert this into a selection of an item in a list. ScrollingThe mouse wheel gives us button 4/5 events. For the Pager, this should be pretty simple. However, Shift/Ctrl Left-ClickSome dialogs allow multi-selection, e.g. Alias dialog. Again, this is likely to need some changes to the Menu. |
Beta Was this translation helpful? Give feedback.
-
ConfigThe final challenge would be to make everything configurable. We'd need to start with a simple:
but we'd want to be able to bind mouse events like keyboard events:
I don't know how this would work :-) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the awesome work laying it all down! 馃槑 This would really be helpful! 馃憤 One more suggestion - maybe adding scrolling to the pager as well? |
Beta Was this translation helpful? Give feedback.
-
This is really needed :/ ?!? just wondering |
Beta Was this translation helpful? Give feedback.
-
Needed? No :-) I'd certainly like to be able to select emails/mailboxes with my trackpad. |
Beta Was this translation helpful? Give feedback.
-
I know I'm just begging in disguise but one nice thing with mouse support would be a header in pager so I can change the sort fields. Also some kinda "quick limit" button such that if I click a particular author/sender, I see their emails. |
Beta Was this translation helpful? Give feedback.
-
I have a touchable device then by some strange chance I found this discussion. Just for fun: diff --git a/key/get.c b/key/get.c
index 8e3dfd3..1030d11 100644
--- a/key/get.c
+++ b/key/get.c
@@ -231,6 +231,7 @@ struct KeyEvent mutt_getch(GetChFlags flags)
SigInt = false;
mutt_sig_allow_interrupt(true);
timeout(1000); // 1 second
+ mousemask(ALL_MOUSE_EVENTS, NULL);
#ifdef USE_INOTIFY
ch = mutt_monitor_getch();
#else
@@ -253,6 +254,14 @@ struct KeyEvent mutt_getch(GetChFlags flags)
}
}
+ if (ch == KEY_MOUSE)
+ {
+ MEVENT event;
+ if (getmouse(&event) == OK) {
+ mvprintw(5, 5, "mouse is pressed on (%d, %d)", event.x + 1, event.y + 1);
+ }
+ }
+
if (ch == ERR)
{
if (!isatty(0)) // terminal was lost Refer: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html |
Beta Was this translation helpful? Give feedback.
-
I'm running NeoMutt with this patch now; thanks a lot @flatcap! |
Beta Was this translation helpful? Give feedback.
-
It's a quick hack. Nothing more. What we need is a volunteer -- Help will be given. |
Beta Was this translation helpful? Give feedback.
-
Adding mouse support to NeoMutt is a big job, but we can start simply.
<sidebar-open>
)<display-message>
)<display-message>
)Beta Was this translation helpful? Give feedback.
All reactions