How do I program a button to double-click by clicking only once

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
naclhead
Posts: 3
Joined: 19 Mar 2017, 00:25

How do I program a button to double-click by clicking only once

19 Mar 2017, 17:58

I just got a 4 button Logitech Trackball Marble. It has 2 big buttons which are right and left click, and the trackball is between to the two big buttons. the 3rd and 4th buttons are little buttons right at the top of the big buttons. No scroll wheel so I would also like to have the trackball act as a scroll wheel maybe with ctrl pressed on the keyboard with my left hand and the trackball would act as a wheel with my right hand and hopefully it would zoom in and out when I'm in my video editing program. I have sever rsi in my right hand so I prefer to have to do as little with my right thumb as possible. And I definitely don't want to do 2 functions at the same time with my right hand such as hold down a mouse button and scroll at the same time. I would much prefer to hold a keyboard button down with my left hand and only use the trackball to scroll with my right hand. Is this making sense? Then if I could program that upper left little button to act as a double click button the way Logitech 3 button mice used the middle button as a double click I would be a happy camper.

One more thing. How do the scripts execute? Do they start up automatically once you enter the code and save the ahk file? Or do you have to reboot you PC and it starts automatically as an autoexe.bat file used to do? Do you have to double click the ahk file each time you want to run it? I'm brand new to ahk though not to programming. I have not done any programming in a few years. While programming concepts are not new to me ahk syntax is. Of course I have to learn the syntax for ahk. But ahk seems to be quite useful and powerful while still simple. I just have to get passed the learning curve. For now I would be happy to just cut and paste already written scripts as I'm sure many have already tackled these simple tasks. No sense reinventing the "wheel" so to speak. Also I see variables like xbutton where I assume x is the number of the of the button. BUT I can't find any documentation as to which buttons are 1, 2, 3, and 4. And how, in ahk syntax, do you refer to the trackball.

I hope someone can help me with this. Please feel free to post me back if you need any clarification. I know I put a lot of questions in this post and I appologize in advance for that.

My best to y'all
Todd

HP Pavillion Dv4 notebook PC
Win Pro 7 SP1, 64 bit OS
Core I3 2.210 ghz 4 Gig Ram,
4GForce
Posts: 553
Joined: 25 Jan 2017, 03:18
Contact:

Re: How do I program a button to double-click by clicking only once

20 Mar 2017, 14:58

naclhead wrote:How do the scripts execute?
Have a look at the tutorial, this is explained in the basics.
https://autohotkey.com/docs/Tutorial.htm
naclhead wrote:Also I see variables like xbutton where I assume x is the number of the of the button. BUT I can't find any documentation as to which buttons are 1, 2, 3, and 4.
Have a look at keylist, also check the special key section at the bottom and follow those steps to identify keys. ( You will need InstallMouseHook to display the mouse buttons in the Key History )
https://autohotkey.com/docs/KeyList.htm
naclhead wrote:And how, in ahk syntax, do you refer to the trackball.
I would guess it acts exactly like a mouse, you can probably achieve what you want with MouseGetPos

Edit: Oh and about the post title ...

Code: Select all

LButton::
	Send {LButton}{LButton}
Return
rfmarves
Posts: 2
Joined: 03 Apr 2014, 10:19

Re: How do I program a button to double-click by clicking only once

17 May 2017, 13:36

I have the exact same trackball and have have been using AHK to do a click-move of the small left button to emulate the scroll wheel. I don't really use the small right button, as I find it too hard to access. You could use another key from the keyboard to accomplish the same thing.

I finished an update to that script I copied from the forums that are now archived. You can find it (once approved) by searching for the "Wheel button emulation script" topic.

Regarding the Logitech Trackball Marble buttons, in AHK, the small left button is XButton1 and the small right button is XButton2. The large buttons are LButton (for Left button) and RButton (for Right button).

For the "have the script execute on startup", I just added it to the startup folder in Windows.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 397 guests