Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse tracking without pressing buttons #75

Open
rigrig opened this issue Oct 21, 2021 · 2 comments
Open

Mouse tracking without pressing buttons #75

rigrig opened this issue Oct 21, 2021 · 2 comments

Comments

@rigrig
Copy link
Contributor

rigrig commented Oct 21, 2021

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

tintin/src/config.c

Lines 598 to 602 in b0fa433

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

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.

@scandum
Copy link
Owner

scandum commented Oct 22, 2021

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.

@rigrig
Copy link
Contributor Author

rigrig commented Oct 22, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants