iohook
iohook copied to clipboard
Crashing After Keydown
Expected Behavior
continuously logging all mouse movement and key presses
Current Behavior
- starts logging mouse movement and clicks
- somewhat of a crash after one key press (not a keyboard shortcut combination, just one key down event)
- stops logging but the script does not exit the runtime
Steps to Reproduce (for bugs)
import ioHook from 'ioHook'
ioHook.start(true)
- installed and run the above script
- move mouse to see logging on console
- hit one key and it crashes and stops logging anything
Your Environment
- IOHook Version: 0.9.3
- Environment: node 14.16
- Operating System and version: desktop macOS
This is a duplicate but will keep open because I'm too lazy to go digging right now. Try using node 12. If you can't then try an earlier 0.7.x version,
Same Problem here. Crash after the first keypress. It did not even enter the on keypress part. The same with earlier versions of IOHook.
Same problem here on Windows though: I'm trying to upgrade an Electron App v11.x.y and iohook v0.7.2 to electron v12.x.y because Electron v11.x.y is now out of support.
I upgraded Electron to 12.1.0 and iohook to v0.9.3 and updated the iohook build targets to node-83 and electron-87 in line with node v14 and Electron v12. Prebuilt build targets were found and downloaded.
The application worked for mouse clicks but as soon as you click a key the app crashed - see the file attached (two examples of crash output copied from console output).
As for the suggested work arounds: I can't use node v12 because the version of node is tied to the version of Electron and if I want to use a supported version of Electron then v12 is the minimum supported and that's using node v14. I can't downgrade the version of iohook to a v0.7.x as suggested because when I do I get the error that the prebuild packages can't be found (this was from a clean install)
Prebuild for current platform (iohook-v0.7.2-electron-v87-win32-x64) not found!
I might try earlier 0.9.x versions of iohook but as above atlan states the same happens with earlier versions of iohook.
So for now it would appear we are stuck on Electron 11.x.y and iohook 0.7.2
iohook_keydown_elelectron_crashdump.txt
Just to add: tried the same test as above with Electron 12, iohook 0.9.3 but with iohook debug enabled to see if this gives any more information as to the source of the crash see file attached below, for context iohook debug messages prior to the crash were for mouse events - moves and clicks which the app was handling as expected but as soon as a key was pressed (n) you get the iohook debug messages, it logs that its dispatching an event of type 5, and then there is the fata error dump.