-
-
Notifications
You must be signed in to change notification settings - Fork 132
Description
I'm working on a PHP keylogger using the Linux evdev API (characted devices in /dev/input/
).
I'm working on the React interface of the library, which is a specialization of my main class.
Using my main (non-React) class and logging the events, I can get this type of log when I press the space key one time (simplified output) :
-- handleData -- -> handleData called
key=57 value=1 -> keydown on space
-- handleData --
key=57 value=0 -> keyup on space
OK. I pressed space one time and I instantly get two events related to the space key. All good.
Now, using the React extend
of my keylogger and doing the same key press :
-- handleData --
key=57 value=1 -> keydown on space
You can notice I don't get the keyup event. Nothing happens until I press another key. So, let's press space another time :
-- handleData -- -> previous log
key=57 value=1 -> previous log
-- handleData --
key=57 value=0 -> it is displayed only now!!
-- handleData --
key=57 value=1 -> ok, expected new keydown
-> missing new keyup... 'til I press another key
I was using EventLoop\Factory::create()
to get the event loop. It was returning a LibEventLoop
. I tried to force the loop class used by replacing the factory with the plain-PHP StreamSelectLoop
. And it works perfectly with this loop class.
I can't try with LibEvLoop
or ExtEventLoop
since these libraries aren't installed on my system.
Maybe it's a quirk of LibEventLoop on character files?
I hope I'm clear enough !