Search found 4471 matches

by evilC
30 Jan 2019, 11:04
Forum: Gaming
Topic: Win10 1809 now seems to support sending synthetic Xbox input
Replies: 0
Views: 138

Win10 1809 now seems to support sending synthetic Xbox input

Just came across this: https://docs.microsoft.com/en-us/uwp/api/windows.ui.input.preview.injection.inputinjector.injectgamepadinput Seems like build 1809 now supports sending as a physical xbox controller, like how AHK can send synthetic keyboard / mouse? Not played with it yet, I don't have 1809 on...
by evilC
30 Jan 2019, 08:25
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 185
Views: 18434

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

@Sdentin - good catch regarding the devices stopping working after sleep.
I will look into it and see if there is anything I can do - maybe I can detect the sleep and re-enumerate the devices or something, thus stopping it from incrementing the device IDs
by evilC
30 Jan 2019, 08:24
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 185
Views: 18434

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

@ppapkor - I don't know how it knows, the input comes *from the driver*, which is exactly how it would look for real input. I have heard reports of some games being able to detect that Interception is installed, and refuse to run, but I have not heard about any games being able to identify a specifi...
by evilC
30 Jan 2019, 07:22
Forum: Ask For Help
Topic: Any help appreciated
Replies: 2
Views: 128

Re: Any help appreciated

FYI Sendinput {ENTER} is unaffected by SetKeyDelay, 200 , whereas all your other Sends are. Dunno if that is intentional or not. Furthermore, if your keys are not reliably recognized by a game, you appear to be setting the wrong value with SetKeyDelay. The 1st parameter controls how long to wait AFT...
by evilC
29 Jan 2019, 12:54
Forum: Ask For Help
Topic: Keyspam. Can't get to work Space or other special keys. Topic is solved
Replies: 3
Views: 122

Re: Keyspam. Can't get to work Space or other special keys. Topic is solved

Code: Select all

Tab::
toggle := !toggle
return

#if toggle
$Space::
$Q::
$W::
while GetKeyState(A_Thishotkey,"P")
{
	Send, % "{" SubStr(A_Thishotkey, 2) "}"
	sleep 200
}
return
#if
by evilC
29 Jan 2019, 12:47
Forum: Ask For Help
Topic: I need help.
Replies: 2
Views: 68

Re: I need help.

I doubt it can be made any faster If anything, it is too fast already - many games will not respond to keys that are not held for at least 20-50ms Also setkeydelay, -1 is not doing anything, as it is incompatible with SendInput Having SetBatchLines in your loop is pointless - you only need to set it...
by evilC
29 Jan 2019, 05:23
Forum: Ask For Help
Topic: Have getkeystate always running?
Replies: 3
Views: 127

Re: Have getkeystate always running?

You are likely using an Xbox One controller. AHK's built-in joystick support will not work properly for those any more, since a recent Win10 update.
You need the XInput library: https://autohotkey.com/board/topic/35848-xinput-xbox-360-controller-api/
by evilC
28 Jan 2019, 06:59
Forum: Gaming
Topic: Rapid fire stucks
Replies: 4
Views: 207

Re: Rapid fire stucks

I think you will find that AutoHotkey detected it just fine, but the game did not. Assume the game polls (checks) the state of the keys every 50ms At t+0, AHK sends key press at t+50, game checks state of key, sees it pressed at t+60, AHK releases key at t+70, AHK presses key again at t+100, game ch...
by evilC
28 Jan 2019, 06:33
Forum: Ask For Help
Topic: What is wrong with my loop?
Replies: 1
Views: 109

Re: What is wrong with my loop?

if %A_index% := 1 is an assignment AND a comparison ( := is assignment), and as such is always true Your code is also inefficient. When you check if A_Index is 1, you should use an ELSE IF to check if it is 2, else even if it is 1, you still check if it is 2 if (A_Index == 1){ } else if (A_Index ==...
by evilC
28 Jan 2019, 06:30
Forum: Ask For Help
Topic: Have getkeystate always running?
Replies: 3
Views: 127

Re: Have getkeystate always running?

Instead of a Loop, use SetTimer. This will fire the code at repeated intervals, whilst allowing the rest of your script to keep on running.
by evilC
28 Jan 2019, 06:27
Forum: Ask For Help
Topic: Keyboard debounce Topic is solved
Replies: 2
Views: 102

Re: Keyboard debounce Topic is solved

Try this - you can add debouncing to a key by using eg db.AddKey("x") to add the x key #SingleInstance force ;~ OutputDebug DBGVIEWCLEAR db := new Debouncer(20) ; Set Debounce Time here db.AddKey("x") db.AddKey("c") return class Debouncer{ KeyFns := {} __New(debounceTime := 20){ this.DebounceTime :=...
by evilC
28 Jan 2019, 05:51
Forum: Gaming
Topic: Rapid fire stucks
Replies: 4
Views: 207

Re: Rapid fire stucks

Your code looks fine I would suggest trying to remove the line SendMode Input , as that mode does not tend to play nicely with games, just use the default mode. 50 is also probably too fast a spam rate. When you send keys too fast (Too little time between press and release), games will often miss ke...
by evilC
28 Jan 2019, 05:45
Forum: Gaming
Topic: Joystick scripts only work if I "Open" the script. Why?
Replies: 1
Views: 87

Re: Joystick scripts only work if I "Open" the script. Why?

This is due to a change MS made with a recent-ish Windows 10 release. Xbox One pads are no longer readable via the WinMM API (The VERY old API that AHK uses to read sticks) when the AHK script is not the active application. You must use the XInput API to read them: https://autohotkey.com/board/topic...
by evilC
25 Jan 2019, 05:31
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 185
Views: 18434

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

You can use function binding to pass extra parameters to the function Here I add the name of the key and the code gotten from GetKeySC #SingleInstance force #Persistent #include Lib\AutoHotInterception.ahk AHI := new AutoHotInterception() keyboardId := AHI.GetKeyboardId(0x04F2, 0x0112) sc := GetKeyS...
by evilC
24 Jan 2019, 12:03
Forum: Ask For Help
Topic: Press a Key to immediately output a single "A", then when held for X milliseconds, it spams "A" until unheld
Replies: 4
Views: 129

Re: Press a Key to immediately output a single "A", then when held for X milliseconds, it spams "A" until unheld

FYI my sample code was set to spam @ 100ms, I think you wanted 10. Just change the line SetTimer, % fn, % (state ? 100 : "Off") to control the spam rate 10ms is one hell of a spam tho (100 times a second), many games will not see that - in fact they will quite possibly treat it as one long press. 10...
by evilC
24 Jan 2019, 11:56
Forum: Ask For Help
Topic: I am baffled... How do you make it so while you hold down a key it presses itself until you let go? Topic is solved
Replies: 10
Views: 347

Re: I am baffled... How do you make it so while you hold down a key it presses itself until you let go? Topic is solved

So timers do not interfere with each other? There is only one timer in this example, but the point is that a while(GetKeyState()) loop locks up the current thread. If, for example, you have a loop running, and you hit a hotkey with a GetKeyState loop in it, the loop in your main thread is suspended...
by evilC
24 Jan 2019, 08:54
Forum: Ask For Help
Topic: I am baffled... How do you make it so while you hold down a key it presses itself until you let go? Topic is solved
Replies: 10
Views: 347

Re: I am baffled... How do you make it so while you hold down a key it presses itself until you let go? Topic is solved

Y'all are forgetting your $ prefix And putting SetKeyDelay in a loop like that is pointless, it only needs to be used once, at the beginning of the script Plus getkeystate loops are just the wrong way to do this - It's all fair and well when there is only one hotkey, but if you try and do this with ...
by evilC
24 Jan 2019, 08:45
Forum: Ask For Help
Topic: when i run scripts as admin and use hotkeys apps that open, run also as admin.
Replies: 3
Views: 156

Re: when i run scripts as admin and use hotkeys apps that open, run also as admin.

Hotkeys are utterly irrelevant in this scenario (Insofar as the processes getting launched as admin is not caused by them being launched by a hotkey) What is relevant is that when an elevated process starts another process, that process is started elevated by default BTW, the technique you used to r...
by evilC
24 Jan 2019, 08:41
Forum: Ask For Help
Topic: Xbox One Controller Bluetooth version (1708) mapping...
Replies: 4
Views: 138

Re: Xbox One Controller Bluetooth version (1708) mapping...

MS recently broke AHK's support for Xbox One controllers in a recent Win10 update. When the script is not the active window, AHK will not be able to read the controller. You need to use the XInput library to properly read them: https://autohotkey.com/board/topic/35848-xinput-xbox-360-controller-api/...
by evilC
24 Jan 2019, 08:36
Forum: Ask For Help
Topic: Press a Key to immediately output a single "A", then when held for X milliseconds, it spams "A" until unheld
Replies: 4
Views: 129

Re: Press a Key to immediately output a single "A", then when held for X milliseconds, it spams "A" until unheld

What you want is often referred to as "Long Press" functionality. It's fairly trivial to do a bodge job that implements it, but to do it properly (In a way that does not have unforseen side-effects as your code gets more complex) is a bit harder. I have a library here that can handle that for you: h...

Go to advanced search