Git Product home page Git Product logo

Comments (4)

wavexx avatar wavexx commented on August 15, 2024

On 19/08/15 14:54, Stanislav Seletskiy wrote:

I want to make it possible for screenkey to act as key logger for
/analyzing my productivity/. But it looks like python-xlib is lacking of
required sequence_number field in XKeyEvent structure, which is required
to detect key repeating. I have decent repeat rate/delay (140/100), so I
do not want to pollute history of logged keys.

Do you have any ideas how to achieve that?

I had to ditch python-xlib, since it didn't really allow to use XKB.

If all you need is the sequence number, it's already in there.
In keylistener.py:247 the event you (as long as is a
KeyPress/KeyRelease) contains ev.xkey.serial.

You could call XkbSetDetectableAutoRepeat so that KeyRelease is never
generated until the key is truly removed.

You can also detect a repeat by checking a release followed by a repeat
with the same ev.xkey.time, which wouldn't need to call
XkbSetDetectableAutoRepeat.

keylistener.py contains a self-test at the bottom when run stand-alone.

from screenkey.

wavexx avatar wavexx commented on August 15, 2024

I pushed some code to detect key repeat. I think it could be useful (maybe) to show the repeat in a different way.

I tried to change the color of the text to grey for repeats, but I find it distracting.
In any case, if you try keylistener, there's a new field "repeated" which you can use.

from screenkey.

seletskiy avatar seletskiy commented on August 15, 2024

@wavexx: Wow, thank you! Get ready to accept new PR 😄

from screenkey.

wavexx avatar wavexx commented on August 15, 2024

I guess we can close this

from screenkey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.