iohook cannot working
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
I use pm2 in my local nodejs program, not a website application. The usage scenario is: when the user presses the keyboard shortcut (enter), my program will take a screenshot of the specified area of the screen. When I use node app.js to start the program, user key press events can be captured normally, but when I use pm2 start app.js, user key press events cannot be monitored. I use the ioHook package as a user key press event capture tool. How can I improve my program? I use pm2 on windows system.
How could we reproduce this issue?
Just start this script in pm2
const iohook = require('iohook')
function ioListener() {
iohook.on('keydown', (e) => {
if (e.keycode === 28) {
console.log('enter was pressed')
}
})
}
ioListener()
Supporting information
# Save the code in app.js above
pm2 start app.js
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduced app.js script and compare node app.js with pm2 start app.js on Windows. Investigate how PM2 launches the process and how the iohook keyboard listener behaves in that context. Done means identifying a reproducible cause and documenting or implementing a PM2-compatible fix for keydown capture.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100