Annoying scrolling with the mouse wheel in the script editor.

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Annoying scrolling with the mouse wheel in the script editor.

Post by Fermin » Sun Apr 04, 2021 11:33 pm

Is there any way to reduce the jumping of the mouse wheel in the script editor?

I don't know if it only happens on Mac but with every little movement, sometimes unintentionally, the text scrolls 8 or 9 lines and it's very easy to lose sight of where I was working. I have to be selecting groups of lines so that, when changing colour, it gives me a visual reference. It's certainly not serious but it is quite uncomfortable. I don't know if this happens to anyone else. I've had the same problem for years and I still haven't found the solution.

And I don't think it's a matter of system preferences because it only happens in Livecode and only in the script editor.

Any suggestions?
Thank you very much.

Translated with www.DeepL.com/Translator (free version)

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by SparkOut » Mon Apr 05, 2021 7:40 am

On Windows I have had issues in the SE where a one-line scroll doesn't stop when it should, continuing without a way of interruption usually until it reaches the top or bottom limit of the script. It is one of many aberrant behaviours in the Windows SE that have defied diagnosis for a long time. Each new version of LC seems to be a bit improved each time, with a few exceptions. Interestingly, I have not had the unstable scroll for a couple of releases. It is odd that these kinds of SE glitches are now being found on Macs too.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by dunbarx » Mon Apr 05, 2021 3:52 pm

I am on a Mac, and have had to live with this forever. The vertical scroll thumb itself is more responsive, but still not perfectly smooth or finely tuned. All these properties are set in the system prefs, not in LC.

But the SE is just a stack. Perhaps something like this might be placed in the SE stack script?

Code: Select all

on rawKeyDown tKey
   if  tkey = 65308 then set the scroll of the target to the scroll of the target + 10
   else    if  tkey = 65309 then set the scroll of the target to the scroll of the target - 10
end rawKeyDown
The "10" is just a suggestion. This works well in a standard scrolling field, giving much finer control.

Craig
Last edited by dunbarx on Mon Apr 05, 2021 8:55 pm, edited 2 times in total.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by jacque » Mon Apr 05, 2021 8:42 pm

dunbarx wrote:
Mon Apr 05, 2021 3:52 pm
I am on a Mac, and have had to live with this forever.
Ditto. I posted this to the mailing list back in 2015:
You've never had that thing happen where you brush up against the mouse and your very long script goes madly scrolling at top speed off into the ether in a direction you can't pinpoint because it happens so fast, careening completely out of control and losing your place, causing you to forget where you were in the code and you can't find it again for a minute, which makes you so furious that you say things you aren't supposed to say, and then your spouse feels guilty because they think they did something you don't like but they don't know what it was?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by Fermin » Tue Apr 06, 2021 12:43 am

:D :D :D :D Exactly the same, Jacqueline, including the detail of brushing the mouse and bye-bye my work area! That's why I've got into the habit of frequently selecting nearby text blocks so that when they are highlighted they let me know where they have gone...
Thanks for your words, I feel less alone in my misfortune. :)

And as for Craig's comment... I don't know how to locate the Scripts editor stack but I confess that it's an area I don't know and I rather not mess with it. As a curiosity I will say that those two numbers 65308 and 65309 I already knew because they are written madly in the script as soon as I move the mouse wheel with the 'alt' key pressed. Thank you :)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by dunbarx » Tue Apr 06, 2021 5:14 am

I have only done this here and there, being skittish about fooling around with the foundations of LC, but they have all been successful. This:

Code: Select all

edit the script of stack "revnewscripteditor 1"
with this added to the stack script so that more than one field will be controlled:

Code: Select all

on rawKeyDown tKey
   if  tkey = 65308 then set the scroll of the target to the scroll of the target + 10
   else    if  tkey = 65309 then set the scroll of the target to the scroll of the target - 10
end rawKeyDown
You can always clear the script if you need to.

Craig

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by Fermin » Sun Apr 11, 2021 7:03 pm

Thank you very much, Craig - sorry for the delay - I have tried your method (rawKeyDown) and although I see that it works, it has some drawbacks. I'll keep testing. :)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by dunbarx » Tue Apr 13, 2021 9:52 pm

Hi.

Find anything definitive in your investigations?

Craig

Fermin
Posts: 142
Joined: Fri Jun 05, 2015 10:44 pm

Re: Annoying scrolling with the mouse wheel in the script editor.

Post by Fermin » Wed Apr 14, 2021 12:51 pm

The truth is that I haven't looked at it for days. I remember that I couldn't write anything in the script, I guess because of rawKeyDown. And I also had to open a new window every time I needed to edit the script of an object (control) -and I always have dozens of controls-. Anyway, I guess not being something 'very native' to LiveCode it doesn't provide as 'straightforward' a solution as I would like. For the moment I've put the topic aside, although I guess I'll come back at some point. :)

Translated with www.DeepL.com/Translator (free version)

Post Reply

Return to “Talking LiveCode”