iohook icon indicating copy to clipboard operation
iohook copied to clipboard

Skipping keys when iohook is enabled on mac

Open aliarshad9691 opened this issue 5 years ago • 6 comments
trafficstars

I am using iohook in an electon app, its like an upwork tracker... I am listening to keyup event and when I start the tracker, my keys starts to skip... its very random and less intense.

Expected Behavior

When iohook is listing, I should be able to use the system normal. I should be able to type normal.

Current Behavior

When iohook is listening to keyup, my keys skip as I type.

Possible Solution

IDK

Steps to Reproduce (for bugs)

  1. Start listing to keyup in an electron app.
  2. start typing anywhere...

Context

It works find in linux and windows. only happen on mac. Have tested it on multiple macbooks.

Your Environment

abi: electron-76 "electron": "8.0.2", "iohook": "^0.6.5",

aliarshad9691 avatar Mar 05 '20 19:03 aliarshad9691

I am having the same issue. It will catch the first key and then it will not catch any more.

ToothpickFactory avatar Mar 15 '20 06:03 ToothpickFactory

Similar issue here. Only allowing 1 key down event. (currently running MacOS Mojave 10.14.6)

var ioHook = require("iohook")

ioHook.on('keydown', function (event) {
    console.log(event.keycode)
    
});

ioHook.start();

josephjh avatar Mar 15 '20 06:03 josephjh

Same issue in a Nodejs app

Code :

"use strict";

const ioHook = require("iohook");

ioHook.on("keyup", (e) => {
  console.log(e);
});

ioHook.start(true);

Output :

→ node index.js
hook_run [1121]: Accessibility API is enabled.
hook_run [1172]: CGEventTapCreate Successful.
hook_run [1178]: CFMachPortCreateRunLoopSource successful.
hook_run [1183]: CFRunLoopGetCurrent successful.
hook_run [1196]: CFRunLoopObserverCreate successful.
dispatch_event [108]: Dispatching event type 1.
hook_enable [257]: Thread Result: (0).
process_key_released [464]: Key 0X1C released. (0X24)
dispatch_event [108]: Dispatching event type 5.
{
  shiftKey: false,
  altKey: false,
  ctrlKey: false,
  metaKey: false,
  keycode: 28,
  rawcode: 36,
  type: 'keyup'
}
process_key_pressed [367]: Key 0X20 pressed. (0X2)
dispatch_event [108]: Dispatching event type 4.
process_key_pressed [379]: Using dispatch_sync_f for key typed events.
ddddddd

nbouliol avatar Apr 28 '20 14:04 nbouliol

Is this still an issue for anyone?

ash0x0 avatar Jun 11 '21 23:06 ash0x0

Just had this exact issue running macOS Big Sur 11.1

const ioHook = require('iohook');

ioHook.on("keydown",function(keyPress){
  console.log(`Keycode: ${keyPress.keycode}`)
});

ioHook.start();

Only output the key code once.

ganiskowicz avatar Jul 30 '21 19:07 ganiskowicz

I'm also having the problem of only logging the first keystroke on a mac, has anyone solved it please? The very bad news is that I'm going to consider using jnativehook for java

liuchengts avatar Dec 10 '22 11:12 liuchengts