JavaScript enthusiast with a growing passion for Python. I love exploring the world of programming, experimenting with code, and discovering new ways to turn ideas into reality.
JavaScript enthusiast with a growing passion for Python. I love exploring the world of programming, experimenting with code, and discovering new ways to turn ideas into reality.
JavaScript enthusiast with a growing passion for Python. I love exploring the world of programming, experimenting with code, and discovering new ways to turn ideas into reality.
Good to remember how can we will solve this kind of promblems! ✌️
I always fight with windows keyboard settings ( forced company laptop ) until I give up the fight. My trick: I use AutoHotkey program to redefine my keyboard to capsLock + ; = é capsLock + ' = á
... and so on
Because my main problem is the hungarian languge special character. In chat with my hungarian collegues I like to use full hungarian char set, but I always use english keyboard set and really hate to install multiple language keyboard set because windows do not saw which keyboard currently use, plus many program using english keyboard shortkeys. The whole question is so anoying.
Creator of GithubStarsManager — an open-source, local-first tool that organizes GitHub stars with AI: auto-categorization, semantic search, release tracking, and an MCP server for star library.
The 0xE8 virtual-key injection is the detail that would have taken me days to find — swallowing S and then watching Start open on Win release is exactly the kind of bug that only shows up in real use. Same for the callback getting garbage-collected with no traceback. And stating outright that the hook only watches the keys it cares about, with nothing logged or stored, is the right call for a keyboard hook. Really nice write-up.
Creator of GithubStarsManager — an open-source, local-first tool that organizes GitHub stars with AI: auto-categorization, semantic search, release tracking, and an MCP server for star library.
Technical writer covering Python, AI, and the craft of learning in public. 30 articles on Python fundamentals, projects, and developer education. FreeCodeCamp Author
The line that hit me: "If HOOKPROC(cb) gets garbage-collected, your app crashes on the next keypress. There's no traceback, it just dies."
That is genuinely the scariest sentence in Python. I'm relatively new to Python, and the silent failures are what keep me up at night—just a flash of a console and then nothing.
The fact that you built a 7,600-line Win32 API app in pure Python is wild. The WASAPI loopback and the Windows OCR workarounds are incredibly useful. I tried recording system audio in Python once, hit a wall with sounddevice, and gave up.
Quick question: what was the biggest headache when packaging this into a .exe with PyInstaller? Did you have to do a lot of custom hooking to include the ffmpeg binaries and the PowerShell OCR scripts?
Massive respect for seeing this through to the end.
This is exactly the gap we hit from the Electron side: globalShortcut.register wraps RegisterHotKey, which silently returns false on any Win+ chord the shell has reserved — so Win+Shift+S is genuinely unreachable from main without a native module that drops to WH_KEYBOARD_LL. The two pitfalls you called out map directly to Electron main-process work too: keeping the HOOKPROC callback referenced at module scope is the same rule as keeping a Tray object — let it GC and the next keypress takes the process down with no stack. The 0xE8 trick to mark Win as 'used in a combo' is the kind of shell-internals detail the docs never mention and that every low-level-hook port eventually rediscovers.
The 0xE8 virtual-key injection was the detail I would never have found on my own — swallowing S but leaving Win to open the Start menu on release is exactly the kind of bug that looks like the code is haunted. The HOOKPROC garbage-collection gotcha is the other one: a crash with no traceback is brutal to debug, so keeping the callback alive and making the hook decision unit-testable is a really nice touch. I also liked the discipline of recording the mic and loopback to separate WAVs and mixing with ffmpeg amix afterwards instead of fighting two drifting clocks in real time. Did the built-in Windows.Media.Ocr hold up on low-contrast screenshots, or is that where you reach for a fallback?
We're a place where coders share, stay up-to-date and grow their careers.
❤️
thanks star for comment
what about your channel?
After Diwali 😀
oh okay channel name StarDev?
Idk yet. Bro please share your github link.😀
github.com/Akhouri-Anmol-Kumar <--my personal
github.com/Akhouri-Systems <--Akhouri Systems
Good to remember how can we will solve this kind of promblems! ✌️
I always fight with windows keyboard settings ( forced company laptop ) until I give up the fight. My trick: I use AutoHotkey program to redefine my keyboard to
capsLock+;=écapsLock+'=á... and so on
Because my main problem is the hungarian languge special character. In chat with my hungarian collegues I like to use full hungarian char set, but I always use english keyboard set and really hate to install multiple language keyboard set because windows do not saw which keyboard currently use, plus many program using english keyboard shortkeys. The whole question is so anoying.
The 0xE8 virtual-key injection is the detail that would have taken me days to find — swallowing S and then watching Start open on Win release is exactly the kind of bug that only shows up in real use. Same for the callback getting garbage-collected with no traceback. And stating outright that the hook only watches the keys it cares about, with nothing logged or stored, is the right call for a keyboard hook. Really nice write-up.
Thanks 😊
You're welcome — and thanks again for the write-up, the callback GC gotcha alone was worth the read. 😊
The line that hit me: "If HOOKPROC(cb) gets garbage-collected, your app crashes on the next keypress. There's no traceback, it just dies."
That is genuinely the scariest sentence in Python. I'm relatively new to Python, and the silent failures are what keep me up at night—just a flash of a console and then nothing.
The fact that you built a 7,600-line Win32 API app in pure Python is wild. The WASAPI loopback and the Windows OCR workarounds are incredibly useful. I tried recording system audio in Python once, hit a wall with sounddevice, and gave up.
Quick question: what was the biggest headache when packaging this into a .exe with PyInstaller? Did you have to do a lot of custom hooking to include the ffmpeg binaries and the PowerShell OCR scripts?
Massive respect for seeing this through to the end.
Bro please change profile pic 🖼️ 🤣
why 😂 I know I look joker but still bro I want that me and akhouri systems both visible in profile hehehe but any more cool idea?
You changed your profile image! Wow!! :D
is that profile pic looking good?
把钩子、回收站删除和原子写入这些小细节都写出来了,读起来很过瘾,收藏了。
This is exactly the gap we hit from the Electron side:
globalShortcut.registerwraps RegisterHotKey, which silently returns false on any Win+ chord the shell has reserved — so Win+Shift+S is genuinely unreachable from main without a native module that drops to WH_KEYBOARD_LL. The two pitfalls you called out map directly to Electron main-process work too: keeping the HOOKPROC callback referenced at module scope is the same rule as keeping a Tray object — let it GC and the next keypress takes the process down with no stack. The 0xE8 trick to mark Win as 'used in a combo' is the kind of shell-internals detail the docs never mention and that every low-level-hook port eventually rediscovers.The 0xE8 virtual-key injection was the detail I would never have found on my own — swallowing S but leaving Win to open the Start menu on release is exactly the kind of bug that looks like the code is haunted. The HOOKPROC garbage-collection gotcha is the other one: a crash with no traceback is brutal to debug, so keeping the callback alive and making the hook decision unit-testable is a really nice touch. I also liked the discipline of recording the mic and loopback to separate WAVs and mixing with ffmpeg amix afterwards instead of fighting two drifting clocks in real time. Did the built-in Windows.Media.Ocr hold up on low-contrast screenshots, or is that where you reach for a fallback?