diff options
author | martinZuther <martinZuther@b9310e46-f624-0410-8ea1-cfbb3a30dc96> | 2009-09-10 23:03:12 +0000 |
---|---|---|
committer | martinZuther <martinZuther@b9310e46-f624-0410-8ea1-cfbb3a30dc96> | 2009-09-10 23:03:12 +0000 |
commit | d2a93f9127bd37dd840586f1a3fde1d3b1fd067a (patch) | |
tree | ff2c1421e4dcee16389696bab41856ef3cc59f56 /linux/osd/develop/xkbtest | |
parent | 6925c4c5f6c59f1534d5b51971cd245a42e8a9fa (diff) | |
download | neo-layout-d2a93f9127bd37dd840586f1a3fde1d3b1fd067a.tar.gz neo-layout-d2a93f9127bd37dd840586f1a3fde1d3b1fd067a.tar.bz2 neo-layout-d2a93f9127bd37dd840586f1a3fde1d3b1fd067a.zip |
Neues Programm "OSDneo2": das Python-Script "OSD Neo2" für Linux zeigt auf dem X-Server die gerade verwendete Ebene von Neo2 an. Version 0.12.
git-svn-id: https://svn.neo-layout.org@2078 b9310e46-f624-0410-8ea1-cfbb3a30dc96
Diffstat (limited to 'linux/osd/develop/xkbtest')
-rw-r--r-- | linux/osd/develop/xkbtest/Makefile | 34 | ||||
-rw-r--r-- | linux/osd/develop/xkbtest/xkbtest.c | 29 |
2 files changed, 63 insertions, 0 deletions
diff --git a/linux/osd/develop/xkbtest/Makefile b/linux/osd/develop/xkbtest/Makefile new file mode 100644 index 0000000..710c1cd --- /dev/null +++ b/linux/osd/develop/xkbtest/Makefile @@ -0,0 +1,34 @@ +# Makefile + +# The compiler to be used +CC = gcc + +# Arguments passed to the compiler: -g causes the compiler to insert +# debugging info into the executable and -Wall turns on all warnings +CFLAGS = -g -O2 + +# The dynamic libraries that the executable needs to be linked to +LDFLAGS = -lxkbfile + +# The Dependency Rules +# They take the form +# target : dependency1 dependency2... +# Command(s) to generate target from dependencies + +# Dummy target that is processed by default. It specifies al list of +# other targets that are processed if make is invoked with no arguments +# However if you invoke make as "make output-data", it will only try to +# generate the file output-data and its dependencies, not plot.png +all : xkbtest + +xkbtest : xkbtest.c + $(CC) $(CFLAGS) $(LDFLAGS) xkbtest.c -o xkbtest + +# The clean target is used to remove all machine generated files +# and start over from a clean slate. This will prove extremely +# useful. It is an example of a dummy target, as there will never be a +# file named clean. Thus "make clean" will always cause the following +# command to be executed. + +clean : + rm -f xkbtest diff --git a/linux/osd/develop/xkbtest/xkbtest.c b/linux/osd/develop/xkbtest/xkbtest.c new file mode 100644 index 0000000..a5c1412 --- /dev/null +++ b/linux/osd/develop/xkbtest/xkbtest.c @@ -0,0 +1,29 @@ +#include <stdio.h> +#include <X11/XKBlib.h> + +int main(int argc, char *argv[]) +{ + int event_rtrn = 0; + int error_rtrn = 0; + int major_in_out = 1; + int minor_in_out = 0; + int reason_rtrn = 0; + + Display * display = NULL; + display = XkbOpenDisplay(NULL, &event_rtrn, &error_rtrn, &major_in_out, + &minor_in_out, &reason_rtrn); + + printf("\n Display handle: %#010x\n", (unsigned int) display); + + XkbStateRec state; + XkbGetState(display, XkbUseCoreKbd, &state); + + printf("\n mods: %x", state.mods); + printf("\n base_mods: %x", state.base_mods); + printf("\n latched_mods: %x", state.latched_mods); + printf("\n locked_mods: %x", state.locked_mods); + printf("\n compat_state: %x", state.compat_state); + + printf("\n\n"); + return 0; +} |