Google
  Web www.spinics.net

Re: XTestFakeKeyEvent and direction arrows

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


On Sun, 27 May 2012 23:46:45 +0200
Giuseppe Penone <giuspen@xxxxxxxxx> wrote:

> Hi,
> I'm writing a simple open source gtk(mm) "on screen keyboard" (
> http://code.google.com/p/giuspen-x-osk/source/checkout)
> and, while all characters and modifiers work pretty good, I'm
> struggling from several days with the direction arrows
> but am absolutely stuck and clueless.
> 
> For all characters and modifiers it works simply with something like:
> 
>         XSync(mp_display, 0);
>         if(flags & FLAG_KEY_DOWN)
>         {
>             XTestFakeKeyEvent(mp_display, XKeysymToKeycode(mp_display,
> keysym), 1 , 0);
>             XFlush(mp_display);
>         }
>         if(flags & FLAG_KEY_UP)
>         {
>             XTestFakeKeyEvent(mp_display, XKeysymToKeycode(mp_display,
> keysym), 0, 0);
>             XFlush(mp_display);
>         }
> 
> but I really found no way to have the direction arrows working.
> 
> The result is that sending the XK_Up and XK_Down arrow doesn't produce
> visible effect, the XK_Left
> and XK_Right instead sometimes produce a double movement and sometimes
> (after messing with XK_Up
> and XK_Down button clicks) produce a single movement in the right
> direction plus a movement up or down.
> 
> If anybody can give me even a simple clue/link that would be of great
> help. Thanks in advance.


 I suspect your key events are going out of sync.  I have put an example
code here [1] ,take a look at the sendKey part


 [1] http://www.delipenguen.net/code/small/f5.c


-- 
 Onur Küçük                                      Knowledge speaks,
 <onur.--.-.delipenguen.net>                     but wisdom listens

_______________________________________________
xorg@xxxxxxxxxxx: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: list-xorg@xxxxxxxxxxx



[X Forum]     [Nouveau Driver]     [Devices]     [XFree86]     [XFree86 Newbie]     [Site Home]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Video for Linux]     [Linux RAID]     [Linux Resources]

Powered by Linux