Do you know of an application that runs on xterm, and uses all the mouse buttons with all the modifiers? Or an argument to show this is not possible?
I have an application that uses the mouse. I managed to use the shift operator and the mouse. I have a problem with the Mac command key and the middle mouse button. If you do this by accident, it blanks the display and stops the application running. I have (tentatively) identified this with the middle button paste.
I would prefer not to disable the middle mouse button entirely. I can use it as it is, and it helps me imitate the user interface of another tool. It is just this special case that I would like to prevent.
Background:
I have an app that shows image info using Ansi-Art. I usually run it using...
xterm -e AnsiView
It uses the alternate screen. It uses the mouse to pan and select areas. If I use the middle button with the Command key the screen goes blank. An ordinary click can bring the display back, but sometimes it looks odd, with white sparkles as though it were being refreshed.
I have tentatively identified this with the middle mouse paste. My guess is that the paste mode gets me out of the alternate screen, which is why my display goes blank. When I get back in, I can occasionally find bits of earlier pasted text in an error message.
An earlier post is not encouraging. It seems the middle mouse paste is a part of X11, and not easily disabled. They're tools such as XMousePasteBlock that will trap the paste messages, but that seems like an extreme approach that would only be used if no other way could be found.
I use my app on Linux and MacOS. I use 'xterm' because it is usually easy to find, and it supports Unicode and Truecolor. Using another terminal is not attractive.
I want to use the middle mouse button as this makes it match another application. I don't want to disable the middle mouse button entirely. If I can't use it with the Command key, I would like to trap the event to avoid the blank screen. I would even settle for a way of putting up a help message, so the user can reset it manually.
NB: I had a similar problem with the Shift modifier, but I got around that with...
xterm -xrm 'xterm*shiftEscape: 2' -e AnsiView
That took some finding. I still wonder if there is an arcane escape sequence that I have missed. If you know there isn't, that would be good to know. I have also tried the various omitTranslation options, but those did not seem to help.
Is there some 'thinking out of the box' solution? Can I (for example) load the insert buffer with a string that gets executed, and takes me back to the alternate screen?