Changing scroll key for DragToScroll script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
califauna
Posts: 6
Joined: 31 May 2016, 19:41

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
Location: OH
Contact:

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: 6
Joined: 31 May 2016, 19:41

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 (v1)”

Who is online

Users browsing this forum: No registered users and 178 guests