Page 12 of 13

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

Posted: 01 May 2019, 04:25
by evilC
Because you are using an AHK hotkey to detect the keystroke, but Interception to send the output. AHK will see keys sent by interception.

Use Interception to detect the keystroke (Use SUBSCRIPTION MODE) and it won't self trigger, because Interception does not see the input it sends

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

Posted: 15 May 2019, 08:05
by evilC

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

Posted: 08 Jun 2019, 14:22
by evilC
v0.4.2 has been released
https://github.com/evilC/AutoHotInterception/releases/tag/v0.4.2
This fixes a major bug with mouse button support

There is slightly more processing going on for mouse buttons - please let me know if you see degradation in performance / responsiveness

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

Posted: 02 Jul 2019, 16:21
by k1ngjosh
Is there a way I can make the script execute only once regardless of how long I hold down the "a" key? When I press and release "a" I get the output of josh once, but when I hold down "a" josh is spammed very fast. I would like it to run only once per press regarless of how long I hold down the key. Thanks
Code Text:

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

Posted: 03 Jul 2019, 04:10
by evilC

Code: Select all

KeyEvent(state){
	global AHI, keyboardId
	static cs
	if (!state){
		cs := 0
		return
	}
	if (cs)
		return
	cs := state
	AHI.SendKeyEvent(keyboardId, GetKeySC("j"), 1)
	AHI.SendKeyEvent(keyboardId, GetKeySC("j"), 0)
	AHI.SendKeyEvent(keyboardId, GetKeySC("o"), 1)
	AHI.SendKeyEvent(keyboardId, GetKeySC("o"), 0)
	AHI.SendKeyEvent(keyboardId, GetKeySC("s"), 1)
	AHI.SendKeyEvent(keyboardId, GetKeySC("s"), 0)
	AHI.SendKeyEvent(keyboardId, GetKeySC("h"), 1)
	AHI.SendKeyEvent(keyboardId, GetKeySC("h"), 0)
}

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

Posted: 05 Jul 2019, 11:47
by k1ngjosh
Thanks for the solution, works great. Is there a way I could implement an on/off toggle to have a key to activate/deactivate the script when pressed?
Edit: Saw your response, thanks it works great

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

Posted: 09 Jul 2019, 09:05
by evilC
v0.4.4 has been released!
Please note that this also contains changes from the v0.4.3 release, which was not announced on this thread as it was experimental.
@k1ngjosh - this release includes a new SetStatus function that you can call to turn on / off subscriptions.

Example usage (The F12 hotkey turns on / off subscriptions - note that it starts ON, so the first time it is called, you should pass false to turn it off)

Code: Select all

#include Lib\AutoHotInterception.ahk

AHI := new AutoHotInterception()

keyboardId := AHI.GetKeyboardId(0x04F2, 0x0112)
AHI.SubscribeKey(keyboardId, GetKeySC("1"), true, Func("KeyEvent"))
toggle := true
return

KeyEvent(state){
	ToolTip % "State: " state
}

F12::
	toggle := !toggle
	AHI.SetState(toggle)
	return

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

Posted: 18 Jul 2019, 14:21
by evilC
AHI 0.4.5 has been released

### Added
- Added TabletButtons demo for converting a graphics tablet into a button box
### Fixed
- Absolute Mode mouse movement subscriptions now work again

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

Posted: 01 Aug 2019, 23:39
by BenevolentDeity
Is this the application that Taran (of second keyboard fame) indicated has a price tag of about $2200 if support for more than 10 devices is required?

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

Posted: 02 Aug 2019, 04:28
by evilC
That's the Interception driver, which this library uses
We tried to pay the money to get that upgraded version, but he would not sell for a one off fee - instead he set up a patreon account and asked for a monthly income and would release it after 6 months or so.
You can see the conversation here: https://github.com/oblitum/Interception/issues/25

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

Posted: 15 Aug 2019, 15:51
by evilC
v0.4.6 has been released!
  • Added MoveCursor method to move the cursor to a specific position
    This is similar to the AHK MouseMove command
  • NumLock is now bindable

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

Posted: 20 Aug 2019, 10:37
by Astrocam
First of all, thank you for building this. I can't wait to get it working.

Downloaded and extracted files, copied Library files to lib, unblocked .dlls, installed driver (I think), restarted pc, removed and reinserted device, and . . .Motitor.ahk is still just a blank GUI.
What am I missing here? Did I skip a step?

Thanks for your help.

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

Posted: 20 Aug 2019, 10:50
by evilC
installed driver (I think)
It should be very obvious if you did it right, you will get a response back from the command-line saying that install was successful.
Did you maybe just double-click the EXE instead of running it from a command-line?

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

Posted: 23 Aug 2019, 07:36
by FordeD
@evilC
i can't get devices from GetDeviceList()
Array length = 0
I test it in monitor script, and monitor script can't give me my devices list. Why?
I install Interception from command line (in administrator)

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

Posted: 23 Aug 2019, 07:37
by evilC
Did you unblock the DLLs?
What version of AHK are you using? If 64-bit, try 32-bit unicode

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

Posted: 23 Aug 2019, 11:44
by tmplinshi
Hi, thanks for lib. I have problems running some of the examples:
---------------------------
Context Example.ahk
---------------------------
Error in #include file "G:\Download\AutoHotInterception\Lib\AutoHotInterception.ahk":
0x80020006 - Unknown name.

Specifically: GetDeviceIdFromHandle

Line#
108: {
109: MsgBox,"Could not get " devType[isMouse] " with VID " VID ", PID " PID ", Instance " instance
110: ExitApp
111: }
112: Return,dev
113: }
115: {
---> 117: dev := this.Instance.GetDeviceIdFromHandle(IsMouse, handle, instance)
118: if (dev == 0)
118: {
119: MsgBox,"Could not get " devType[isMouse] " with Handle " handle ", Instance " instance
120: ExitApp
121: }
122: Return,dev
123: }

Continue running the script?
All I did is I replaced
id1 := AHI.GetKeyboardId(0x04F2, 0x0112, 1)
to
id1 := AHI.GetKeyboardIdFromHandle("ACPI\VEN_PNP&DEV_0303")

Although I got it working by modifying the GetKeyboardIdFromHandle method in AutoHotInterception.ahk:

Code: Select all

	GetKeyboardIdFromHandle(handle, instance := 1) {
		; return this.GetDeviceIdFromHandle(false, handle, instance)
		return this.Instance.GetKeyboardIdFromHandle(handle, instance)
	}

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

Posted: 23 Aug 2019, 11:55
by evilC
Ohh, I think I maybe see the issue - it's passing true/false, but the GetDeviceIdFromHandle method uses a lookup table with 1/0 for keys.
I am not sure what I was smoking when I wrote that

Does this also fix it?
[code]
GetKeyboardIdFromHandle(handle, instance := 1) {
return this.GetDeviceIdFromHandle(0, handle, instance)
}
[/code]

Edit, actually, no, doesn't look like it would, that lookup table is only for the error message
I think it is maybe related to how AHK C# interop works with booleans?

Ohh, I see the issue, I moved that method to a helper class in the C#

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

Posted: 23 Aug 2019, 16:28
by evilC
v0.4.8 of AHI has been released!
https://github.com/evilC/AutoHotInterception/releases/tag/v0.4.8
Fixed the bug @tmplinshi just reported
Updated the Monitor app - there are now Copy buttons to copy the VID/PID of your device to the clipboard

[Edit] I forgot to prefix the VID/PID with 0x, so I deleted release 0.4.7 and re-released as 0.4.8

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

Posted: 24 Aug 2019, 01:17
by tmplinshi
Thanks for the update! It works now.

Just a small bug of the Copy buttons, it copies wrong result, the & character becomes &&.
For example I got ACPI\VEN_PNP&&DEV_0303 instead of ACPI\VEN_PNP&DEV_0303.

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

Posted: 24 Aug 2019, 07:28
by evilC
Thanks for the heads up!