How does AHK work

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
true_mogician
Posts: 5
Joined: 24 Oct 2021, 12:27
Contact:

How does AHK work

24 Oct 2021, 12:54

I'm recently trying to write a driver for PS2 keyboard to make it possible to handle custom key combinations until I came across AutoHotKey today to find that this awesome script language had already done what I'm trying to do, and far more than that! Nearly had I spent days just to reinvent a wheel :lol:
Now I'm wondering how do AHK scripts work. As far as I've observed, AHK doesn't work as a driver - no virtual devices pop up in Device Manager when installed, and the project is basically written in C++ instead of C. But how could a general application take over all keyboard and mouse (and even joystick) events to work as a middleware? This seems to be a filter driver's work.
Forgive me for asking such questions about an open-source project. I've already browsed the repository, but the project is too large to get an overall comprehension just with a few looks. I've also googled this subject, with nothing valuable found. So I end up here asking for help.
Appreciations in advance for all sorts of help!
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: How does AHK work

24 Oct 2021, 14:12

RegisterHotkey api, SetWindowsHookEx api with LL mouse keybd and journal hook, Post/SendMessage api, GetKeyboardStateAsync api and similar helper functions, a lot of big brain work based on feedback and complaints from users over the course of 20 years
true_mogician
Posts: 5
Joined: 24 Oct 2021, 12:27
Contact:

Re: How does AHK work

24 Oct 2021, 20:48

swagfag wrote:
24 Oct 2021, 14:12
RegisterHotkey api, SetWindowsHookEx api with LL mouse keybd and journal hook, Post/SendMessage api, GetKeyboardStateAsync api and similar helper functions, a lot of big brain work based on feedback and complaints from users over the course of 20 years
Ah, thank you for the reply! I've never thought Windows would offer such convenient APIs for software. Looks like there're lots of interesting things to explore in WinAPI :D

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 9 guests