SetSelection functions to control output highlight

Posted by Fiendish on Mon 27 May 2019 09:11 PM — 5 posts, 20,781 views.

USA Global Moderator #0
Like the opposites of GetSelectionStartColumn, GetSelectionEndColumn, GetSelectionStartLine, and GetSelectionEndLine. Instead of reporting what is highlighted, they would control what is highlighted.
Australia Forum Administrator #1
Why would you want to do this? If I am sitting at my keyboard I don't expect text to suddenly be selected while I am gazing out the window at the unicorns.
USA Global Moderator #2
Quote:
I don't expect text to suddenly be selected while I am gazing out the window at the unicorns

It would be based on actual user interaction in a way that makes sense.

I've written a splitscreen scrollback plugin that shows the most recent text as a native-looking overlay over the bottom section of the output when the player scrolls up, and it allows text highlighting using the same code that I developed over the years for my chat capture miniwindow. If a player highlights some text in the main output and then scrolls up, I can currently propagate their highlight into the miniwindow so that they still see it active, but if they highlight something in the miniwindow I have no way to propagate that back to the main output (both for access to native Ctrl+C copying and also so that the highlight is still there when they scroll all the way to the bottom and the overlay goes away).

Here's a video showing what it currently looks like: https://gofile.io/?c=WQ2JJ1
Amended on Tue 28 May 2019 07:59 PM by Fiendish
Australia Forum Administrator #3
Added to pre-release version 5.07.

https://github.com/nickgammon/mushclient/commit/0d02b24

Template:function=SetSelection
SetSelection

The documentation for the SetSelection script function is available online. It is also in the MUSHclient help file.

USA Global Moderator #4
Yay