2

How can I "listen" to stream of key press events with Python?

I want to do something like this:

click_stream.map(lambda k: k.key)

But how can I create this click_stream?

kharandziuk
  • 12,020
  • 17
  • 63
  • 121

1 Answers1

0

It depends on the UI framework, but basically you should:

  • create a Subject
  • call the Subject.on_next method in the event callback passing the required args
  • subscribe to the Subject

you can use the timeflies example as a guide.

Community
  • 1
  • 1
mkzqeyns
  • 71
  • 2