0

I was surprised by the lack of information on that topic. Long story short, I have a piece of code to register key events. It works fine unless the key is pressed for a long time, it starts to repeatedly report itself being pressed and released. It is a common thing, but I don't want it. In any text editor when a key is pressed and then held for some time it just continuously puts it, yet I'd like to avoid that in my application, how do I do so? (Code sample used to catch events provided)

    XEvent tmp;
    bool ret = XCheckWindowEvent(d, w, 
        ExposureMask | KeyPressMask | KeyReleaseMask, 
        &tmp);

My first question so please tell me if I did something wrong.

KittenLover
  • 3
  • 2
  • 3
  • Does this answer your question? [Ignore auto repeat in X11 applications](https://stackoverflow.com/questions/2100654/ignore-auto-repeat-in-x11-applications) – Hasturkun Jan 14 '21 at 13:21

1 Answers1

0

There is no way to ignore coded in Xlib. You can code the ignorance yourself. The solution can be found here.

EDIT: NO NEED TO WRITE YOUR OWN SOLUTION. This functionality is brought in using XAutoRepeatOn(Display *) and XAutoRepeatOff(Display *);

KittenLover
  • 3
  • 2
  • 3