Global Hotkey with X11/Xlib

Your program works here. My guess is you have another modifier active, such as NumLock. GrabKey only works on the exact modifier mask. For example here is some (GPL) code from metacity window manager /* Grab/ungrab, ignoring all annoying modifiers like NumLock etc. */ static void meta_change_keygrab (MetaDisplay *display, Window xwindow, gboolean grab, int keysym, … Read more

How do I efficiently determine if a polygon is convex, non-convex or complex?

You can make things a lot easier than the Gift-Wrapping Algorithm… that’s a good answer when you have a set of points w/o any particular boundary and need to find the convex hull. In contrast, consider the case where the polygon is not self-intersecting, and it consists of a set of points in a list … Read more