Search found 4822 matches

by evilC
09 Jul 2021, 13:47
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

It's also worth adding that there's more of a benefit to doing DirectInput reading via SharpDX - trying to poll directinput using native AHK calls would probably be hella tricky, and whilst you can already read DI devices using GetKeyState, that's limited to 6 axes, 32 buttons whereas SharpDX gives ...
by evilC
09 Jul 2021, 13:43
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

You may see less CPU usage due to the loop being in compiled code rather than interpreted? That may, however be offset by the overhead of the interop between C# and AHK
by evilC
09 Jul 2021, 10:33
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

Both are poll-based. I think APIs generally work like this because of the way games work. The game does not want to be interrupted while it is rendering, it will want to poll the input, then render, then poll the input again, render again etc. Handling disconnect (certainly for XInput) would be simp...
by evilC
06 Jul 2021, 17:36
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

Oh crap, I completely forgot (I wrote this so long ago...), this library does support XInput... To view the C# source, simply open the JoystickWrapper.sln file using Visual Studio. There's a TestApp project in there as well as the JoystickWrapper which allows you to test the library entirely within ...
by evilC
06 Jul 2021, 15:12
Forum: Scripts and Functions (v1)
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 345
Views: 205527

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

mavz Windows mouse keys will probably not see keys sent by AHK's Send command, so probably won't work. Instead you should use AHI to send the keys eg ^a::AHI.SendKeyEvent(1, GetKeySC("Numpad4"), 1) ^a up::AHI.SendKeyEvent(1, GetKeySC("Numpad4"), 0) But in general, this will be rubbish, as it won't ...
by evilC
06 Jul 2021, 14:56
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

Do I need to keep All you need is the JoystickWrapper.ahk file and the DLLs I plan on only using xinput and want to keep the least amount of overhead. XInput ?! I would recommend against using this library to read XInput devices. Both triggers will report as one merged axis, and it will be impossib...
by evilC
30 May 2021, 05:34
Forum: Tips and Tricks (v1)
Topic: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a
Replies: 30
Views: 63281

Re: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a

Or, to demonstrate a slightly more elegant way of doing it: keyStates := {} return a:: SendKey("x", true) while (GetKeyState("a")){ Sleep 100 } SendKey("x", false) return b:: SendKey("y", true) while (GetKeyState("b")){ Sleep 100xy } SendKey("y", false) return F1::Gosub CheckKeys SendKey(key, state)...
by evilC
30 May 2021, 05:20
Forum: Tips and Tricks (v1)
Topic: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a
Replies: 30
Views: 63281

Re: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a

Or, to demonstrate the kind of bug that this thread is about: keyStates := {} return a:: SendKey("x", true) while (GetKeyState("a")){ Sleep 100 } SendKey("x", false) return b:: SendKey("y", true) while (GetKeyState("b")){ Sleep 100 } SendKey("y", false) return F1::Gosub CheckKeys SendKey(key, state)...
by evilC
30 May 2021, 05:16
Forum: Tips and Tricks (v1)
Topic: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a
Replies: 30
Views: 63281

Re: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a

Your code is not doing anything like what mine was doing. Granted, my code contained some typos (I wrote it from memory, didn't test it) - I was missing a bracket on the GetKeyState, and my send syntax was a bit garbled but once I fixed that it exhibits what I am talking about (Post edited to fix co...
by evilC
29 May 2021, 06:43
Forum: Tips and Tricks (v1)
Topic: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a
Replies: 30
Views: 63281

Re: Why you should avoid while(GetKeyState("a", "P")) to detect release of key a

You could create an array, and whenever you programmatically hold or release a key, update the array. Then, if you want to know if anything is stuck, just check the state of the array keyStates := {} return a:: SendKey("x", true) while (GetKeyState("a")){ Sleep 100 } SendKey("x", false) return F1::G...
by evilC
14 May 2021, 14:35
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

Another solution is just to right-click the zip, properties and check the "unblock" box bottom right.
Then unzip the zip
by evilC
14 May 2021, 12:00
Forum: Gaming Scripts (v1)
Topic: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017
Replies: 40
Views: 33887

Re: [Alpha]JoystickWrapper: Read Joysticks via DirectInput / XInput without loops (C# DLL) 0.0.5 - 18th Mar 2017

I run it by downloading and extracting the source code zip from Alpha 0.0.5 and running the SimpleExample script. If you downloaded the source code from the main GitHub page, then you won't have the DLLs, so it won't work. You need to download from the Releases page (The "Download" link in this thr...
by evilC
09 Apr 2021, 08:28
Forum: Ask for Help (v1)
Topic: Using keyboard and external numpad in AutoHotInterception
Replies: 1
Views: 448

Re: Using keyboard and external numpad in AutoHotInterception

You are going to have to be more specific than "Work with mouse keys", I really don't understand what your requirement is. Also, a quick look at your code tells me that you are subscribing to two keyboards and pointing them at the same function - there is going to be no way that your KeyEvent functi...
by evilC
02 Mar 2021, 12:37
Forum: Gaming Help (v1)
Topic: Reading file in order to react
Replies: 14
Views: 3700

Re: Reading file in order to react

No, you misunderstand. I was meaning that you do something like this lt := new CLogTailer("myfile.txt", Func("NewLine")) return NewLine(text){ if (I_find_what_I_want_from_the_log_and_wish_to_stop_the_initial_parse){ return true } } However, upon looking at my code, your NewLine function would not kn...
by evilC
02 Mar 2021, 08:08
Forum: Gaming Help (v1)
Topic: Reading file in order to react
Replies: 14
Views: 3700

Re: Reading file in order to react

If using the first example (The one from Apr 27) then you can just return TRUE from your function to tell it to stop doing the initial parse through the log
by evilC
16 Feb 2021, 06:45
Forum: Scripts and Functions (v1)
Topic: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Replies: 124
Views: 43819

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

In that screenshot, you have not changed to the hotvoice folder before running the command
You are trying to unblock the windows folder!
by evilC
12 Feb 2021, 10:09
Forum: Scripts and Functions (v1)
Topic: [WIP] HotClass - Dynamic Hotkey and Binding system
Replies: 10
Views: 4824

Re: [WIP] HotClass - Dynamic Hotkey and Binding system

I never really ended up pursuing it more - If memory serves I originally wrote this for potential use with UCR The AHK version of UCR has now been deprecated in favour of a C# version , however I distilled down the dynamic hotkeys system that I used for UCR into the AppFactory library. I also now ha...
by evilC
19 Nov 2020, 10:51
Forum: Ask for Help (v1)
Topic: Listen to keystrokes during script execution
Replies: 12
Views: 3331

Re: Listen to keystrokes during script execution

With that code, KeyPress() is never getting called because you changed the signature - you have 4 parameters (extra type parameter) instead of 3
by evilC
19 Nov 2020, 10:41
Forum: Ask for Help (v1)
Topic: Listen to keystrokes during script execution
Replies: 12
Views: 3331

Re: Listen to keystrokes during script execution

Oh, you mean AHK hotkeys, not normal windows shortcuts - totally different thing.
If the AHK hotkey definitions you have are context sensitive, then if the context is active, they will override the ones declared by AllKeyBinder
by evilC
19 Nov 2020, 09:22
Forum: Ask for Help (v1)
Topic: Listen to keystrokes during script execution
Replies: 12
Views: 3331

Re: Listen to keystrokes during script execution

By default it won't block the keys (Allowing existing shortcuts to work) There's an optional 2nd parameter ("pfx") that is used as a prefix for all hotkeys it declares, and it defaults to ~ This can be overridden in the constructor eg kb := new AllKeyBinder(Func("MyFunc"), "*") to make keys block an...

Go to advanced search