iohook icon indicating copy to clipboard operation
iohook copied to clipboard

Drops of events in windows

Open hmake98 opened this issue 4 years ago • 11 comments

Iohook stopped in windows platform.

The scenario in detail: Iohook is supported with electron js environment. But somehow It's not working in windows platform with the use of electron js. It's dropping events sometimes with random behavior. I tried to install VC_redistx64.exe. But, It'll fix the issue for a temporary basis.

Here's my environment detail:

  • nodejs version: 10.16.3
  • electron js version: 5.0.2
  • Iohook version: 0.6.5

hmake98 avatar May 29 '20 06:05 hmake98

Hey, thanks for opening an issue. Could you provide a minimum reproducible example ?

Djiit avatar Jun 30 '20 20:06 Djiit

Hey @Djiit, I can share a demo. But, there is a random behavior. and major of this issue we're facing is in windows system.

hmake98 avatar Jul 12 '20 10:07 hmake98

@Djiit I also found this problem. When I listen to keydown/keyup, sometimes I can't get events. Only in windows os.

xudaolong avatar Jul 14 '20 02:07 xudaolong

In my case, I saw some users's windows will drop events or trigger wrong events. I think all due to the protect software which in user's pc.

ape-casear avatar Jul 20 '20 06:07 ape-casear

Maybe it could help. If electron run on user right, but you make active an application's window with admin right (right mouse click run as administrator). You couldn't get events.

vovazubko avatar Jan 13 '21 16:01 vovazubko

I think i had found the reason! libuiohook listen a event names EVENT_OBJECT_NAMECHANGE on windows. when the event is triggered, libuiohook will unhook all listener and rehook it.

when the event emited after unhook and before rehook, it will lost!

I am try to remove the code of SetWinEventHook on EVENT_OBJECT_NAMECHANGE. it looks good!

I found the commit of this changed on it: https://github.com/kwhat/libuiohook/pull/14

TLeaves avatar Jan 16 '21 09:01 TLeaves

Is it currently an issue or was it fixed? Is it something that was resolved upstream?

ash0x0 avatar Jun 11 '21 23:06 ash0x0

@ash0x0 Yes, It's still coming up in the windows system.

hmake98 avatar Jun 12 '21 17:06 hmake98

@ash0x0 Yes, It's still coming up in the windows system.

Is there a pattern to this that you noticed or is it completely random? I haven't been able to repro, does it happen after some time or right away? With certain applications or after certain events?

ash0x0 avatar Jun 12 '21 17:06 ash0x0

@ash0x0 It's completely random. It's most probably occurs when the app is freshly installed into the system.

hmake98 avatar Jun 13 '21 16:06 hmake98

I had fixed this bug on my repo. But it is a temporary modification because only remove the logic of SetWinEventHook. I think it's a better way to do a configuration. But I am not familiar with this. If you know how to do, please tell me.

https://github.com/TLeaves/iohook/commit/226ce6c27243337075050002b641c13232077d96

TLeaves avatar Jun 15 '21 05:06 TLeaves