summarylogtreecommitdiffstats
path: root/shiftpressed.c
diff options
context:
space:
mode:
Diffstat (limited to 'shiftpressed.c')
-rw-r--r--shiftpressed.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/shiftpressed.c b/shiftpressed.c
new file mode 100644
index 000000000000..71358ab8b9f9
--- /dev/null
+++ b/shiftpressed.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/ioctl.h>
+
+int main()
+{
+ char shift_state;
+
+ shift_state = 6;
+ if (ioctl(0, TIOCLINUX, &shift_state) < 0) {
+ perror("ioctl TIOCLINUX 6 (get shift state)");
+ exit(1);
+ }
+ printf("%x\n", shift_state);
+ return 0;
+}