mouseposition and keyremaping

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest

mouseposition and keyremaping

25 Aug 2017, 01:02

Code: Select all

z::s
return

s::
 mousemove, 100,100
return
Hi,

using above script, when you press Z, the mouse move to position 100,100. I dont want that. I want to receive "s" when i press z. How to do that?

[if i replace mousemove with keymapping [f.ex. s::d] it works as i want, just with mousemove it behave different ]
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: mouseposition and keyremaping

25 Aug 2017, 01:22

do:

Code: Select all

z::s

#InputLevel 1
s::
	mousemove, 100,100
return
#InputLevel 0
User avatar
DyaTactic
Posts: 221
Joined: 04 Apr 2017, 05:52

Re: mouseposition and keyremaping

25 Aug 2017, 02:19

@obeeb
Is the use of #InputLevel prefered over forcing the keyboard hook with the $ prefix?
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: mouseposition and keyremaping

25 Aug 2017, 10:43

@DyaTactic
No, $ should definitely be used, that was my bad.

@OP
If you are still here your code can be greatly simplified to:

Code: Select all

z::s
$s::mousemove, 100,100

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], oktavimark, Rohwedder and 244 guests