Changing scroll key for DragToScroll script

Get help with using AutoHotkey and its commands and hotkeys
califauna
Posts: 2
Joined: 31 May 2016, 19:41
Facebook: DaleNewton

Changing scroll key for DragToScroll script

31 May 2016, 19:54

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!
User avatar
lifeweaver
Posts: 144
Joined: 10 May 2014, 05:57
GitHub: lifeweaver
Location: OH

Re: Changing scroll key for DragToScroll script

02 Jun 2016, 14:13

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
califauna
Posts: 2
Joined: 31 May 2016, 19:41
Facebook: DaleNewton

Re: Changing scroll key for DragToScroll script

20 Jun 2016, 18:14

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.

Return to “Ask For Help”

Who is online

Users browsing this forum: anaxio, Bing [Bot], elvisautohotkey, Google [Bot], michael_jie, takayo97 and 205 guests