InputHook small improvement - different keyboards

Propose new features and changes
0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

InputHook small improvement - different keyboards

Post by 0xDEADC0DE » 28 Sep 2019, 18:40

The new InputHook looks very interessting.
For me it would solve a lot of problems if I could distinguish between different keyboards.
So the hook should have the option to only react on keys pressed on a specific keyboard or
also good would be if the hook would return me some information on which keyboard the
hook was pressed.

In my case, I need it to have different hotkeys on my notebook and on my external keyboard.
E.g. on my external keyboard, I use right Ctrl very often, on my notebook not so I have remapped it
to the context menu key.
Currently I need to disable this hotkey when I plugin my notebook into my docking station.

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: InputHook small improvement - different keyboards

Post by lexikos » 28 Sep 2019, 23:42

Low level keyboard hooks can detect and intercept/block input, but cannot differentiate between keyboards.
Raw Input can differentiate between keyboards, but cannot intercept/block input.
Keyboard filter drivers can do all of this and more, but cannot reside within a user mode program.

AutoHotkey uses only a low level keyboard hook. InputHook is built around its capabilities.

In short, what you ask is possible in general, but is unlikely to ever become part of AutoHotkey itself.

0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

Re: InputHook small improvement - different keyboards

Post by 0xDEADC0DE » 29 Sep 2019, 04:43

What a pitty. With a function I could query to get the keyboard used for the keypress, there would be a lot of possibilities.
Thanks for your answer.

ahk7
Posts: 575
Joined: 06 Nov 2013, 16:35

Re: InputHook small improvement - different keyboards

Post by ahk7 » 29 Sep 2019, 05:38

@0xDEADC0DE perhaps:

1. AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=45307

2. AHKHID
https://autohotkey.com/board/topic/38015-ahkhid-an-ahk-implementation-of-the-hid-functions/

3. HIDMacros (using external program)
https://autohotkey.com/board/topic/55921-multiple-keyboards-workaround/
HIDMacros is no longer developed, but there is a successor by the same dev. luamacros
https://github.com/me2d13/luamacros
which seems to work with AHK as well https://github.com/resir014/ahk-luamacros-test

0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

Re: InputHook small improvement - different keyboards

Post by 0xDEADC0DE » 29 Sep 2019, 15:27

Thanks for the links.
It's a bit much to do for what I want to do.

User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: InputHook small improvement - different keyboards

Post by evilC » 05 Nov 2019, 12:28

AHKHID and HIDMacros can differentiate keyboards, but cannot block
I forget if I added the functionality to AutoHotInterception to notify on all keys, but could add it if not - under the hood you subscribe to a whole device anyway, so it would be fairly simple to just add a flag to fire the callback for all keys


Post Reply

Return to “Wish List”