diff options
Diffstat (limited to 'enable_X11_numlock.c')
-rw-r--r-- | enable_X11_numlock.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/enable_X11_numlock.c b/enable_X11_numlock.c new file mode 100644 index 0000000..836a4de --- /dev/null +++ b/enable_X11_numlock.c @@ -0,0 +1,13 @@ +#include <X11/extensions/XTest.h> +#include <X11/keysym.h> + +int main(int argc, char **argv) +{ + Display* disp = XOpenDisplay( NULL ); + if( disp == NULL ) + return 1; + XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock ), True, CurrentTime ); + XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock ), False, CurrentTime ); + XCloseDisplay( disp ); + return 0; +} |