[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: XInput2 -- Filtering and Replaying keyboard
From: Patrick Herbst <paherbst () gmail ! com>
Date: 2020-06-17 22:53:32
Message-ID: CACMdL5+yZbq1Djy+_6ND-N-1tyJMQmf=4+Smce4sFEYy2is3yQ () mail ! gmail ! com
[Download RAW message or body]
I'm working on some filtering code to filter out keyboard events from
a specific keyboard.
for an example, i'm just trying to capture 'a'
...
XIGrabKeycode(dpy, kbd_id, XKeysymToKeycode(dpy, XK_a),
DefaultRootWindow(dpy), GrabModeSync, GrabModeAsync, 0, &mask, 1,
&modifiers_inout);
....
XNextEvent(dpy, &evt);
printf("event: %d %x\n", evt.type, evt.xany.window);
if (XGetEventData(dpy, &evt.xcookie) &&
evt.xcookie.extension == xi_opcode)
{
dev_event=evt.xcookie.data;
XIAllowEvents(
dpy,
kbd_id,
XIReplayDevice,
CurrentTime);
}
This captures 'a' just fine, but it doesn't replay it for the focus
window. Am i missing something?
Similar code works fine when using legacy XGrabKey, but XInput2 isn't
working for me.
Thanks!
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic