aboutsummaryrefslogtreecommitdiff
path: root/shiftdown/shiftdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'shiftdown/shiftdown.c')
-rw-r--r--shiftdown/shiftdown.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shiftdown/shiftdown.c b/shiftdown/shiftdown.c
new file mode 100644
index 0000000..bfd0a02
--- /dev/null
+++ b/shiftdown/shiftdown.c
@@ -0,0 +1,12 @@
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+int main() {
+ char shift_state;
+ shift_state = 6;
+ if (ioctl(0, TIOCLINUX, &shift_state) == -1)
+ err(1, "could not get shift state");
+ return !shift_state;
+}