programming fire key which shows two times as lbutton

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

programming fire key which shows two times as lbutton

Post by Shekhar Singh » 29 Jan 2023, 03:55

how do i customise the fire key of my mouse ,

in keyboard history it comes up as two times of anything i assigned on lbutton .
any suggestions . ?
Attachments
Screenshot_20230129_132039.png
Screenshot_20230129_132039.png (64.58 KiB) Viewed 1190 times

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 29 Jan 2023, 06:44

Code: Select all

#Requires AutoHotkey v1.1.33
LButton::
While GetKeyState("LButton", "P")
 Send 6
Return

Code: Select all

#Requires AutoHotkey v2.0
LButton:: {
 While GetKeyState(ThisHotkey, "P")
  SendEvent 6
}

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 29 Jan 2023, 07:17

no , it didnt worked both lbutton and fire key showed the same text with same number of 6
Attachments
Screenshot_20230129_174656.png
Screenshot_20230129_174656.png (4.29 KiB) Viewed 1125 times

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 29 Jan 2023, 07:31

What is your specific example of what you would like achieve with the button?

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 29 Jan 2023, 08:26

i would like to achieve
Alt + k with fire key
because that will help me in word .

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 29 Jan 2023, 09:14

Code: Select all

; This script reassigns the middle mouse button
#Requires AutoHotkey v1.1.33
#If WinActive("ahk_exe WINWORD.exe")
MButton::Send !k                      ; MBUTTON sends ALT-K
#If

Code: Select all

; This script reassigns the middle mouse button
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe WINWORD.exe")
MButton::Send '!k'                    ; MBUTTON sends ALT-K
#HotIf

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 29 Jan 2023, 09:28

is there a way to program the fire key separately from lbutton

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 29 Jan 2023, 09:29

Perhaps you can help me to understand what the fire key is. The last script does not use LButton.

See: mouse buttons.

If you have a script, you can post it in a new reply below. Indicate what the script does when you run it, and what it should do instead.

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 29 Jan 2023, 13:30

fire key is an extra mouse key provided as 6th mouse button .

Itsjob is to do the same as whatever is assigned on LButton in quick sucession .
In some games , like counterstrike it is used to fire bullets .
from ahk key history , what i am seeing is thst it shows two times lbutton have been pressed .
that;s how it appears . any way to differentiate from l button

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 29 Jan 2023, 14:03

I see. My only suggestion is to see whether it comes with mouse utility software to reprogram that special button. If it is just always triggering LButton twice and cannot be changed, then this is more challenging unless you always want to use that button when you double-click things, instead of LButton. If that is the case, then a new hotkey can be crafted for LButton that distinguishes a single click from a double click. An example of that is provided in the AHK documentation.

https://www.autohotkey.com/docs/v1/lib/SetTimer.htm#ExampleCount

Others may have additional ideas for you here.

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 31 Jan 2023, 22:59

hi sir , i will take that ,
can you help with the code to make double click a separate hotkey .
to put the required code to press Alt + h
thanks .

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: programming fire key which shows two times as lbutton

Post by mikeyww » 31 Jan 2023, 23:03

Instead of writing the script, I have cited the script that has already been written to do that.

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 02 Feb 2023, 04:30

hi sir,
i ran into one issue , although its working ,
but on a single press , its not pressing lbutton but sending text " LButton"
Attachments
Screenshot 2023-02-02 150048.png
Screenshot 2023-02-02 150048.png (47.22 KiB) Viewed 878 times

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 02 Feb 2023, 06:34

i used ,
Send , {LButton}
it worked , but i am not able to select items by dragging lbutton across . this is issue i am currently facing.

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: programming fire key which shows two times as lbutton

Post by DuckingQuack » 02 Feb 2023, 07:57

That’s because you reassigned lbutton to only click lbutton… mikeyww will know more but I suspect this is a case where hotkey modifier symbols are needed.
https://www.autohotkey.com/docs/v1/Hotkeys.htm#Symbols
Best of Luck,
The Duck

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 02 Feb 2023, 08:44

hi @mikeyww sir ,
can you help with this issue , i am a but not select text .

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: programming fire key which shows two times as lbutton

Post by DuckingQuack » 02 Feb 2023, 09:07

So, the problem with slapping a modifier symbol in there like ~ would be that when you use the fire key, it would probably try double clicking (highlighting text or activating an icon). I don’t have any good suggestions outside of: if your mouse came with software that allows changing what key they simulate, then you could use that software to avoid messing with lbutton. Logitech and Razor normally have this kind of software support, so depending on your manufacturer, you may want to check their websites for something to support your mouse.
Best of Luck,
The Duck

Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

Re: programming fire key which shows two times as lbutton

Post by Shekhar Singh » 02 Feb 2023, 10:15

no additional customisable sofware is provided with mouse.

rwh531
Posts: 8
Joined: 03 Feb 2023, 02:56

Re: programming fire key which shows two times as lbutton

Post by rwh531 » 03 Feb 2023, 06:11

The fire key generally just repeats the action in quick succession, most mice that have them contain software to change the keys action, I for example use a Reddragon m913 wireless mouse and set the keys function to Ctrl though I should note when rebinding the key it loses the repeat quickly effect on my mouse however my mouse software also allows me to make custom macros so i can hold down any key and i put a 20ms delay between the down/up to imitate pressing the key faster than humanly possible (can reduce the delay further but it tends to cause issues. Highly suggest playing with the software that came with your mouse or using ahk to make any other key repeat the same action

Post Reply

Return to “Ask for Help (v1)”