I have a problem when remapping WheelLeft to press the Left key...

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Nour T
Posts: 2
Joined: 24 Sep 2018, 08:31

I have a problem when remapping WheelLeft to press the Left key...

24 Sep 2018, 08:39

So, I have been fondling a bit around AutoHotkey for a good while and it's really a versatile language. I could finally type a long ass password by just a simple command without going to a password manager and copy and paste, it's like a safe haven for lazy people. xD

Anyhoo, I have made a simple script which would help me assign the WheelLeft as the Left key in the keyboard, since some picture viewers like XnViewMp uses them as this, and I'm being lazy enough to not bother using them. I thought I'd solve this problem by typing this code:

Code: Select all

WheelLeft::Left
It's just a simple one as a test to see if it works or not. And it did! But its a bit annoying as I need to literally do a single click to the left, and most of the times it just gets to the VERY left when I just did a slight touch. So I thought that it needs a solution. Couple of searches later, I have got my code to this:

Code: Select all

WheelLeft::
	Send, {Left}
	KeyWait, WheelLeft
	return
Easy, right? Well, I tried to press the WheelLeft, it did actually work! Second time however, it doesn't. Heck, the code just broke out and it just wouldn't let me to even go left as soon as I press the WheelLeft. Maybe it's the program's fault I thought, so I went on to try and do it to any text and nope, it still works only the first time and then that's it. So I need a solution for that...

TL;DR: I tried to remap WheelLeft to press Left key, but it keeps on sending it repeatedly as I hold it. So I went to make a code that would supposedly help prevent that, but it just sends one time and stops sending anymore. Like, first click works, second click doesn't, and so is third and forth.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: I have a problem when remapping WheelLeft to press the Left key...

25 Sep 2018, 17:34

In the documentation for remapping, there is a list of keys that are not supported...

WheelLeft cannot be "pressed" and "released" (since it represents a change in position, not a key or button), therefore it cannot be mapped to a key. You can use a plain hotkey (with Send) instead.

KeyWait will not do anything meaningful for the same reason. It does not have down and up states.

Edit: In some mice it is a button you can hold down, but as far as Windows is concerned, you are scrolling a wheel continuously.
Nour T
Posts: 2
Joined: 24 Sep 2018, 08:31

Re: I have a problem when remapping WheelLeft to press the Left key...

01 Oct 2018, 19:47

Awwwwww. That sucks. Well, Thank you for asking anyway!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: w_i_k_i_d and 313 guests