Hid Macros?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rammblood
Posts: 2
Joined: 28 May 2021, 14:21

Hid Macros?

28 May 2021, 14:34

Hi everyone,
I'm new in this forum and I don't know almost anything about this type of scripting. I'm trying to create a second keyboard remapped so that every time I press a key it activates a macro. Something like this: https://www.youtube.com/watch?v=Arn8ExQ2Gjg
Unfortunately I need a program that makes Windows understand from which keybord the input comes from. I tried with Luamacros and interception but they all have problems for me, so I found Hid Macros that works well but I don't know how to make it "communicate" with AutoHotKeys. With Hid Macros you can only run an application pressing a key, but I want to create macros with AutoHotKeys, can someone help me finding the way to make them communicate/finding a "compatible" application?
Thanks a lot and sorry for my English
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Hid Macros?

28 May 2021, 16:57

I have followed the instructions of the video. Apparently the LUA program makes when pressing a key on the second keyboard at a time, a F24 key is pressed, in such a way that when pressing the "Q" key, it is as if it is pressed Q+F24, which is evidently different that Just press "Q". In the following example, and once LUA has been executed (the second keyboard stops working in its usual way), pressing the "Q" key on the second keyboard, the "NotePad.exe" program is opened in Windows.

Code: Select all

~F24::
FileRead, key, c:\AHK\2nd-keyboard\LUAMACROS\keypressed.txt
If (key = "q")
Run c:\Windows\notepad.exe
Cool :dance: . Now a new field of possibilities is opened for autohotkeys. I do not know if there is a similar script in AutohotKeys, who do the same as LUA.
(The file "keypressed.txt" is just a .txt com file the text "right")
imNotTupid
Posts: 31
Joined: 29 Jul 2020, 23:07

Re: Hid Macros?

28 May 2021, 18:40

I tried using Lua macros and interception. It was a bad idea. Rapid key presses are ignored. Writing a text file to the sdd/hd and then reading that file is extremely slow. Installing interception also limits your total hid devices (to 15?). I uninstalled it.

I suggest checking out AHKHID. It's written in AHK. You can use it to detect other keyboard (and mouse) inputs and execute macros.
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Hid Macros?

28 May 2021, 21:56

imNotTupid wrote:
28 May 2021, 18:40
I tried using Lua macros and interception. It was a bad idea. Rapid key presses are ignored. Writing a text file to the sdd/hd and then reading that file is extremely slow. Installing interception also limits your total hid devices (to 15?). I uninstalled it.

I suggest checking out AHKHID. It's written in AHK. You can use it to detect other keyboard (and mouse) inputs and execute macros.
I have been reading several forums, but in none comes something very concrete. imNotTupid, could you use an example for a script as simple as that of my previous entry?
Rammblood
Posts: 2
Joined: 28 May 2021, 14:21

Re: Hid Macros?

29 May 2021, 03:57

imNotTupid wrote:
28 May 2021, 18:40
I tried using Lua macros and interception. It was a bad idea. Rapid key presses are ignored. Writing a text file to the sdd/hd and then reading that file is extremely slow. Installing interception also limits your total hid devices (to 15?). I uninstalled it.

I suggest checking out AHKHID. It's written in AHK. You can use it to detect other keyboard (and mouse) inputs and execute macros.
Ok thanks, but I don't understand how to make it work... :crazy:
Could you please link me some good tutorial or explain me rapidly how does it work?
Thanks
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Hid Macros?

29 May 2021, 05:00

Hello.

I found another thread where another method developed (https://www.autohotkey.com/boards/viewtopic.php?f=6&t=45307). But in my case the script "Monitor.AHK", does not open the appropriate way on a 4K monitor and no ID appears. The method with LUA has been easy for me, but not other developments with autohotkeys. It is supposed to read all the thread, in which I have linked has 15 pages. This afternoon...

Rammblood, I do not know if you mean me or "imnottupid".
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Hid Macros?

29 May 2021, 10:08

Hello! :wave:

I summarize the four possibilities to do it (which I have found).

1. Through the LUA program, as explained above.
2. Through a program called "intercept.exe", which creates a file called "keyremap.ini", which as its name suggests, it is a map of the second keyboard. Is well explained here: https www.youtube.com /watch?v=Y3E_RI-VOIO Broken Link for safety
3. Through AHKHID, which is found in this thread: https://autohotkey.com/board/topic/38015-ahkhid-an-ahk-implementation-of-the-hid-functions
4. Through "Autohotinterception", which has the next thread: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=45307

For my knowledge (and time to invest to learn), the first two are easy. The other two I do not understand them. You have to have a lot of more self -OTKEY knowledge than I have. Lua (first method) creates a virtual function key (F24), which is the most optimal. The second method is through one of the function keys of the second keyboard (F12 in the explanation video), which can create conflicts with some programs that use that key.
Archimede
Posts: 550
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Re: Hid Macros?

24 Jul 2022, 16:01

Hallo.
I am making a program that communicate with Hid macro; are you interested about it?
letacio
Posts: 48
Joined: 08 Mar 2018, 16:05

Re: Hid Macros?

20 May 2023, 17:44

#ar
Archimede wrote:
24 Jul 2022, 16:01
Hallo.
I am making a program that communicate with Hid macro; are you interested about it?
I am!!
Archimede
Posts: 550
Joined: 25 Nov 2021, 09:49
Location: Switzerland / Italy

Re: Hid Macros?

23 May 2023, 02:46

Hallo.
I saw only now your interest.
The program I am building is very complicate; it will allow to communicate by remote access from many computers at the same time to one computer with many screens, using keyboard too...
are you interested on it? I tell you that is very complicate: it is totally asynchronous and it must manage keyboards like a special keyboard driver...
If you are interested on it I am happy to send you it , that is no ended, I am building it...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], peter_ahk and 255 guests