iohook
iohook copied to clipboard
(Electron) Iohook events (mousemove/mousedown, etc) are not working on Chrome latest version (93.0.4577.82)
Expected Behavior
The mousemove and mousedown and keydown events should be captured using iohook on Chrome (93.0.4577.82).
Current Behavior
The mousemove and mousedown and keydown events CANNOT be captured using iohook on Chrome (93.0.4577.82).
This Chrome IS NOT the electron chome, just the Chrome application on the desktop. the log not showing anything. Outside Chome window area, iohook works again and log start to show event. Move mouse back to Chrome window the log disappears again just look like the events on the Chrome tab/window cannot be captured by iohook.
Possible Solution
Do not know what's the cause.
Steps to Reproduce (for bugs)
This code snippet running in a Election application
- start electron application
- start iohook with above code (triggered by button click)
- minimize the application window.
- click on desktop or other application, the event logs are shown.
- Start a Chrome on desktop
- click or mouse move in Chrome window, no event logs are shown.
- minimize the Chrome window
- click on anywhere else, the event logs are shownd again.
Your Environment
- IOHook Version: 0.9.3
- Environment name and version : Chrome (93.0.4577.82), Nodejs 14, Election 12.0.12
- Operating System and version : Windows 10 Home x64bit,
- GPU : NVIDIA GeForce 640MX, Driver version: 471.75
Sounds like security restrictions, try running your packaged electron app (or dev electron) as administrator and see if the same events are captured that way.
@marcelblum Hey man, you are so smart! After I run as administrator the problem disappears, however I just wondering that the Chrome also opened by the same user as my application, why the event cannot be captured in Chrome window? If you facing same issue before could you please tell me the cause of this and is it a configure issue regarding Chrome or Windows 10? how I could fix this by changing some configuration?
I have an Electron 12 project that uses iohook 0.9.3 and when I run the packaged app on Win 10 alongside latest Chrome I can't reproduce this problem unless I run chrome as admin. So I think the issue is due to some specific settings on your computer. Note that with Windows security restrictions, programs that are not running with elevated privileges are prevented from tracking input in programs with elevated privileges. So the most likely cause would be that your Chrome is set to always run as administrator (maybe this is something you once set intentionally for some reason?). You can check if Chrome is running "elevated" in the Task Manager. If not, then the cause might be more tricky to determine, maybe some custom security settings or antivirus interference?
@marcelblum thank you so much for your detailed feedback, you are absolutely a star to me. Based on your comment I did fund that the Chrome run as elevated everytime I start double click on chrome.exe without any UAC alart, however if I run chrome in cmd it becomes "un-elevated", I never intented to startup chrome on elevated mode and I cannot think of anything I did make chrome behave this way, so still not sure why this is happening, however I do know that this issue has nothing to do with iohook now. Thank you again for your detail explaination and patient.
I'm still researching why and nothing seems like to be the answer or solution, the chrome.exe is not setting "Run as Administrator" in properties, so if you know reset the chrome back to normal please let me know, thanks in advanced.
That's really odd, I can only guess that Chrome was installed in some particular way that is making that happen, so maybe just try uninstalling/reinstalling. Keep in mind even a shortcut can have "run as administrator" checked. So even if the actual exe doesn't have that set in the properties, but you start it from a shortcut that does, it will run elevated. Good luck.