tintin icon indicating copy to clipboard operation
tintin copied to clipboard

Mouse tracking without pressing buttons

Open rigrig opened this issue 4 years ago • 2 comments

Currently #config MOUSE ON enables "Button-event tracking", but there is also an even more verbose mode called "Any-event mode", which reports cursor movements even when no button is pressed. (https://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking)

Changing https://github.com/scandum/tintin/blob/b0fa43339e199bfdfced35b97e92d85d31287be9/src/config.c#L598-L602 to (i.e. 1002 to 1003)

        print_stdout(0, 0, "\e[?1000h\e[?1003h\e[?1016h");
    }
    else
    {
        print_stdout(0, 0, "\e[?1000h\e[?1003h\e[?1006h");

seems to enable things like (after I created a url MSLP link) #event {MOVED SECURE LINK url MOUSE} {#showme url: %4 -4 -30}, (or just plain #event {MOVED MOUSE}.)

Just enabling those would be nice, but I wonder if maybe we could also have some TinTin-filtered events? something like

  • #event {ENTER LINK url MOUSE} {#showme Only fires once, when mouse enters link region}
  • #event {LEAVE LINK url MOUSE} {#showme Fires once, when mouse leaves link region}

My use case would be showing the command that will be sent on clicking when you hover the mouse over a link. Or for a list of rooms: on left-clicking the room name currently my script speedwalks you there, while right-clicking shows the map at that location. It would be neat if I could just show the map when hovering over the link.

rigrig avatar Oct 21 '21 22:10 rigrig

I've got it disabled since it makes #config mouse info obnoxious to use. #showme \e[?1003h\ and #showme \e[?1003l\ work though as an alternative to #config.

ENTER/LEAVE might be possible, I'll add it to my todo list.

scandum avatar Oct 22 '21 17:10 scandum

Thanks, that makes sense. And I hadn't realized you can just #showme those codes :-)

rigrig avatar Oct 22 '21 18:10 rigrig