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
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!
How does AHK work
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
Discuss Autohotkey related topics here. Not a place to share code.
-
- Posts: 5
- Joined: 24 Oct 2021, 12:27
- Contact:
Re: How does AHK work
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
-
- Posts: 5
- Joined: 24 Oct 2021, 12:27
- Contact:
Re: How does AHK work
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