Page 1 of 1

Changing scroll key for DragToScroll script

Posted: 31 May 2016, 19:54
by califauna
Hi all,

I'm trying to get this script working with a keyboard key instead of a mouse button: https://autohotkey.com/board/topic/5528 ... scrolling/

Basically it allows horizontal and vertical scrolling with any document or app like Adobe's right click then drag to scroll feature, for example in Notepadd++, where this function isn't available.

I have tried to change the key used from a mouse button to a keyboard key (via the settings dialogue, as well as in DragtoScroll.ini config file), but it is not working correctly. DragtoScroll sees the key repeated rather than held down. The drag icon appears and scrolling begins briefly but then scrolling stops and the 'Slow mode' or 'fast mode' tooltip appears. This suggests to me that it has received multiple clicks of that button, as doubeclick activates those functions by design.

I have tried with sendplay, SendInput, Send, MouseClick, Click, and SendEvent to no avail (obviously using Up and down messages), eg:

Code: Select all

* a:: 
MouseClick, right,,, 1, 0, D
KeyWait a
MouseClick, right,,, 1, 0, U
Return
The settings dialogue allows entry of keyboard keys as the scroll key, but is this just not going to work?

Thanks!

Re: Changing scroll key for DragToScroll script

Posted: 02 Jun 2016, 14:13
by lifeweaver
Hi califauna,

I was able to find a copy of the script and found that by adding these two sippits that the script seemed to work for keyboard keys.
Disclaimer: I don't use the program myself so I only briefly tested the scrolling with default settings.

At the top of the ButtonDown label:

Code: Select all

if(KeyIsDown == true)
  return
KeyIsDown := true
At the top of the ButtonUp label:

Code: Select all

KeyIsDown := false

Re: Changing scroll key for DragToScroll script

Posted: 20 Jun 2016, 18:14
by califauna
lifeweaver wrote:Hi califauna,

I was able to find a copy of the script and found that by adding these two sippits that the script seemed to work for keyboard keys.
Disclaimer: I don't use the program myself so I only briefly tested the scrolling with default settings.

At the top of the ButtonDown label:

Code: Select all

if(KeyIsDown == true)
  return
KeyIsDown := true
At the top of the ButtonUp label:

Code: Select all

KeyIsDown := false

Thanks, that worked for me too.