Re: XTestFakeKeyEvent() and key repetition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hallo  

> To begin with, I let some other dudes test the program and I got different 
> reports... :) It repeated for some, but not for all. You don't happen to be 
> running 4.3? That could be an explanation.
I think this has nothing to do with the version you/they are running.
Someone has set you key to NOT be repeated. I think you should set your
key(s) to autorepat. You can do it globally.... like this:


#include <X11/Xlib.h>
#include <stdio.h>


int 
fake_me (Display *dpy)
{
  XTestFakeKeyEvent(dpy, 10, True, 0);
  XFlush(dpy);
  sleep(2);
  XTestFakeKeyEvent(dpy, 10, False, 0);
  XFlush(dpy);
}


int main()
{
  Display *dpy;

  dpy =XOpenDisplay(NULL);

  XAutoRepeatOn(dpy);
  fake_me(dpy);
  
  printf ("-----\n"); fflush (stdout);

  XAutoRepeatOff(dpy);
  fake_me(dpy);
  
  printf ("-----\n"); fflush (stdout);

  XAutoRepeatOn(dpy);
  fake_me(dpy);
  
  XCloseDisplay(dpy);
}


Which you can compile with:
 gcc -o autox autox.c -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXtst
and yes, the file  to save this crap into shalt be calleth: autox.c

Does that work?

> > Hi .... I am sorry the answer took so long!
> Oh, yes... I was beginning to get really mad at you! :)
> 
> > OK... I think you have to turn on autorepeat for the key(s). Take a look
> > at the following man pages:
> >   XChangeKeyboardControl
> >   XAutoRepeatOn (and off)
> Thanks, I'll check them out.

Well, get in with it;)
... and while you're at it:
    XGetKeyboardControl

> So why the hell are we writing in English? :)
Vet ej!


_______________________________________________
XFree86 mailing list
XFree86@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/xfree86

[Index of Archives]     [X Forum]     [Xorg]     [XFree86 Newbie]     [IETF Announce]     [Security]     [Font Config]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux Kernel]

  Powered by Linux