-
-
Notifications
You must be signed in to change notification settings - Fork 418
fix:Fix the issue where hotkey listeners cannot be triggered when the… #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… CapsLock light is constantly on in macOS systems.
@spongeBor Based on my testing, when the Caps Lock key is active (indicator light is on), deactivating it causes the hotkey listener to stop responding to any key events. |
This bug is causing keyboard shortcuts to malfunction when using our company's tools. So far, we've only identified this particular scenario. Based on previous reports, the shortcut failure issue has also been encountered on Windows systems. |
@spongeBor Yes, I tested your code on my device, but unfortunately, it still doesn't resolve the issue where the hotkey listener stops working after toggling Caps Lock. |
I will check the code behavior later and get back to you. |
I've made some optimizations. If you encounter any other edge cases or unhandled scenarios, please inform me and I'll investigate this issue further. |
@spongeBor I've pulled your branch and tested it, but the issue still persists. After holding down Caps Lock and then releasing it to deactivate, the key press events stop responding correctly. ![]() |
I added a test commit. Please help verify whether it behaves consistently with what's described in this comment. From the test results, it appears the issue has been completely resolved.Looking forward to your reply. |
@spongeBor You didn’t commit the test file—only the compiled files were included. I’ve compiled it locally, and unfortunately, the issue still persists. It hasn’t been resolved. |
我用我的提到的测试方法一定是可行的,能否告知你是如何测试的,我来试下 |
@spongeBor 我的测试方法
我在 Chrome Version 137.0.7151.69 (Official Build) (arm64) 上测试的 |
经过我多次的测试,确实复现了您说的这个现象;
|
6e47128
to
6e9c0bd
Compare
6e9c0bd
to
efd98f1
Compare
我已经移除了站点的console.log代码,而且更新了dist部分代码,悉知 |
我终于明白了问题出现在哪里,我测试的时候顺手修复了这个问题,我的方法是直接排除 CapsLock 键 @spongeBor |
@spongeBor 噢,我又想了想,CapsLock 在 macOS 下面是问题键,在windows和 Linux 上可能不是,是不是这个bug 修复得有点大意了,是否需要在 加个判断是否只是在 macOS/iOS 下才排除 CapsLock |
Lines 103 to 109 in 194b93c
在 macOS 下面摁下大写之后 key code 不一样 @spongeBor |
排除capsLock确实是一个简单的修复方式;
|
@spongeBor 感谢🙏,我关闭掉 PR,根据你的分析,我觉得没有必要去考虑其它平台是否需要排除 capslock,这样可以保持一致,避免奇怪的兼容问题 |
问题背景:
修复方案:
这个修复确保了即使在 CapsLock 灯常亮的情况下,相关的快捷键监听器也能正常工作。
Problem Background:
Fix Solution:
This fix ensures that even when the CapsLock light is constantly on, related shortcut key listeners can still work properly.