Skip to content

Tag: xlib

Propagating all events from a X window

I’a currently working on a small utility, it’s my first ever X project. The utility is used to draw a small circle around your mouse pointer. I use an app called Pinpoint to do the same on my Mac, it helps me find my mouse as I’m visually impaired. The utility creates an transparent X window…

global hotkeys using xlib

I’m trying to get my C application to execute certain tasks when the ctrl+k button is pressed(OR CTRL SHIFT K not sure yet), documentation is a bit sccarce but I was able to find a cpp example and tried to mimic that code: I understand the keypresses are captured by the XGrabKey function, the xnext even…

Get UTF-8 input with X11 Display

I’ve been trying and reading lots of resources on the internet, trying to find a way to get an UTF-8 keyboard (composed) input from a X Display. But I could not make it work. I have tried the example code from this link (exaple 11-4), but no success. I also have written a simple example (below) to try t…

Why XGrabKey generates extra focus-out and focus-in events?

Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it? (or “to use XGrabKey() without generating Grab-style focusout”?) (or “How to get rid of NotifyGrab and NotifyUngrab focus events at system level?) The XGrabKey will lose focus …