I'm quite new to AHK, and I've been trying to write a script for me to use my Numpad9, 6, and 3 keys to emulate the Numpad1, 2, 4, 5, 7, and 8 keys, since they've broken, and they're important in many roguelike games. It's a fairly simple script, but when I run it, it returns the error:
"Error at line 6.
Line text: Numpad7
Error: This line does not contain a recognized action.
This program will exit"
As you can likely tell, I have no idea how to fix this problem. Checking the documentation, everything seems to be correct. Of course, knowing my skill with this kind of thing, it's probably something painfully obvious. Here's the code I'm using:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
NumpadMult::SetNumLockState AlwaysOn
NumpadEnter & Numpad9::Numpad7
NumpadEnter & Numpad6::Numpad4
NumpadEnter & Numpad3::Numpad1
NumpadAdd & Numpad9::Numpad8
NumpadAdd & Numpad6::Numpad5
NumpadAdd & Numpad3::Numpad2
Error with Numpad7
Re: Error with Numpad7
(Don't like our code boxes?)
Hmm... I wonder why it doesn't work. It seems that combination hotkeys (using &) don't work that way. Instead, you have to use Send, like this:
Hmm... I wonder why it doesn't work. It seems that combination hotkeys (using &) don't work that way. Instead, you have to use Send, like this:
Code: Select all
NumpadMult::SetNumLockState AlwaysOn
NumpadEnter & Numpad9::Send {Numpad7}
NumpadEnter & Numpad6::Send {Numpad4}
NumpadEnter & Numpad3::Send {Numpad1}
NumpadAdd & Numpad9::Send {Numpad8}
NumpadAdd & Numpad6::Send {Numpad5}
NumpadAdd & Numpad3::Send {Numpad2}
Re: Error with Numpad7
Not OriginKey1 & OriginKey2::DestinationKey. Custom combinations are not supported.The syntax for the built-in remapping feature is OriginKey::DestinationKey.
Source: Remapping Keys and Buttons
Re: Error with Numpad7
Thanks, Chaz. Also, I didn't realize these forums had code boxes, though in hind sight, that should have been obvious
Re: Error with Numpad7
[code]Guests are not allowed to use BBCode tags[/code]
Source: I'm posting as a guest.
Source: I'm posting as a guest.
Re: Error with Numpad7
I didn't know that. Might I ask why that is? I didn't even know we could post as a guest.kon as guest wrote:Source: I'm posting as a guest.Code: Select all
Guests are not allowed to use BBCode tags