Web lists-archives.com

Re: XTestFakeKeyEvent GDK-equivalent

Hello Emmanuele,

Well, my requirements allow an only-X or -Wayland solution, but I totally understand what you mean, I feel it is weird using a testing API do implement functionality.
My current solution is using uniput to create a virtual device in user space, I'm just having trouble with the keyboard layout, GDK was my hope to convert char -> keysym and send it directly to the X server. I guess I'll just have to get the mapping right in both server and client, either manually or trying to read XKB mappings.
I'm looking at Onboard (https://code.launchpad.net/~onboard/onboard/trunk) code and I think they do what I want.

Anyway, thank you for the help.

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On 7 July 2018 9:51 AM, Emmanuele Bassi <ebassi@xxxxxxxxx> wrote:


virtual keyboards running outside of the windowing system platform as clients do not use the XTest API — mostly because it's meant only for testing X, and because it's only for X. Injecting synthetic events into the windowing system is just not going to give you what you want, if what you want is to write a input driver. Additionally, GDK won't let you do this because GDK is a client toolkit, and it can only consume events coming from the windowing system, not inject them for random clients to process.

You will need to write a device driver — either for X11, or for the Linux kernel — that does this for you.


On Fri, 6 Jul 2018 at 01:49, Anarchean via gtk-list <gtk-list@xxxxxxxxx> wrote:

I'm working into implementing a virtual remote keyboard/touch pad daemon for Linux, currently I'm dumping events into an uinput device, but that is giving me some trouble with my keyboard layout (which is brazillian, br-abnt2). I was looking for a way to this in X, found XTestFakeKeyEvent and was wondering if I could make it simpler and cross-platform using
GDK3. I tried this attached code, but it doesn't do anything. I was wondering if someone has done this before and know what I'm doing wrong or if I should just give up doing with GDK.

Also, this is an extra, if I can't just fake key events, what should I use to map unicode chars into linux/input.h event key codes based on my keyboard layout on X? What about Wayland?

Thank you!

Sent with ProtonMail Secure Email.

gtk-list mailing list


gtk-list mailing list