The thing I want to do is when u hold mouse4, it automatically starts to spam numpad4 and i can change the hotkey speed time
Hope u can help me
![Smile :)](./images/smilies/icon_e_smile.gif)
Code: Select all
delay = 25
XButton1::
SetKeyDelay, delay
While GetKeyState("XButton1", "P")
Send {Numpad4}
Return
thanks for your help! but how can i change numpad4 to my keyboard right number 4?mikeyww wrote: ↑13 Aug 2022, 12:33Welcome to this AutoHotkey forum!
Code: Select all
delay = 25 XButton1:: SetKeyDelay, delay While GetKeyState("XButton1", "P") Send {Numpad4} Return
doesn't work for memikeyww wrote: ↑13 Aug 2022, 13:00It should be the same, but here are the key names. https://www.autohotkey.com/docs/commands/Send.htm#keynames
Code: Select all
XButton1::Send, {Right}{Numpad4}
i mean when i press mouse4 it will spam numpad4 key (keyboard right number 4)boiler wrote: ↑14 Aug 2022, 03:12What do you mean by “right numpad4”? Do you mean you want it to press the right arrow key followed by the Numpad4 key, like below?Code: Select all
XButton1::Send, {Right}{Numpad4}
Code: Select all
/* Scan code ----------------------------------------------------
This script gets a scan code from a key.
It copies the corresponding Send command to the clipboard.
By mikeyww on 14 August 2022 • For AutoHotkey 1.1.34.03
https://www.autohotkey.com/boards/viewtopic.php?p=477399#p477399
-----------------------------------------------------------------
*/
#InstallKeybdHook
Menu, main, Add, Exit, GuiEscape
Menu, main, Add, List
Menu, main, Add, KeyHistory, History
Menu, main, Add, About
Gui, +AlwaysOnTop
Gui, Font, s10
Gui, Menu, main
Gui, Add, Text , w230 , Press a key.
Gui, Add, Hotkey, wp vhk gGet
Gui, Add, Text , wp y+20, Scan code:
Gui, Add, Edit , wp vsc ReadOnly
Gui, Add, Edit , wp vsc2 ReadOnly
Gui, Add, Text , wp y+20, Send command:
Gui, Add, Edit , wp vcmd ReadOnly
Gui, Show,, Scan code
Return
History:
KeyHistory
Return
Get:
Gui, Submit, NoHide
GuiControl,, sc , % sc := Format("{:03X}", GetKeySC(hk))
GuiControl,, sc2, % sc2 := "SC" sc
GuiControl,, cmd, % Clipboard := "Send {" sc2 "}"
Return
List:
FileRecycle, % out := A_ScriptDir "\scanCodes.txt"
Loop, 0xFF {
n := 0x100 - A_Index
vk := Format("{:02X}", n)
key := "VK" vk
sc := GetKeySC(key)
name := GetKeyName(key)
(name != "") && list .= Format("{:03} {} {:03X} {}", n, vk, sc, name) "`n"
}
Sort, list
FileAppend, % Trim("N VK SC Key`n--- -- --- ------------`n" list, "`n"), %out%
Run, %out%
Return
About:
MsgBox, 64, About,
(
This script gets a scan code from a key.
It copies the corresponding Send command to the clipboard.
By mikeyww on 14 August 2022 • For AutoHotkey 1.1.34.03
https://www.autohotkey.com/boards/viewtopic.php?p=477399#p477399
Press CTRL-C to copy this box's text to the Windows clipboard.
)
Return
GuiClose:
GuiEscape:
ExitApp