summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharethewisdom2019-06-09 11:49:19 +0200
committersharethewisdom2019-06-09 11:49:19 +0200
commit41d2f8aeea4a9548a8208dd53519bb8dc7fc3ed1 (patch)
tree852eb3e65985f639c5458789c33eb884258331d8
downloadaur-41d2f8aeea4a9548a8208dd53519bb8dc7fc3ed1.tar.gz
initial commit
-rw-r--r--.SRCINFO13
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD21
-rw-r--r--shiftpressed.c17
4 files changed, 56 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cc712c4a2306
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = shiftpressed
+ pkgdesc = Detect if shift is pressed in the console
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://aur.archlinux.org/packages/shiftpressed
+ arch = any
+ license = custom:Public Domain
+ makedepends = gcc
+ source = shiftpressed.c
+ sha256sums = f0c5327edf12f63eb74fe6a88928eb926664338eb7da60c8ebce80aabccb3645
+
+pkgname = shiftpressed
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f61b62b6a818
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*
+!PKGBUILD
+!shiftpressed.c
+!.gitignore
+!.SRCINFO
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1fae9bed553e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,21 @@
+# Maintainer: Bart De Roy <de dot roy dot bart at gmail dot com>
+pkgname=shiftpressed
+pkgver=1.0.0
+pkgrel=1
+pkgdesc='Detect if shift is pressed in the console'
+arch=('any')
+url='https://aur.archlinux.org/packages/shiftpressed'
+license=('custom:Public Domain')
+makedepends=('gcc')
+source=(shiftpressed.c)
+sha256sums=('f0c5327edf12f63eb74fe6a88928eb926664338eb7da60c8ebce80aabccb3645')
+
+build() {
+ cd $srcdir
+ gcc -o shiftpressed shiftpressed.c
+}
+
+package() {
+ cd $srcdir
+ install -Dm755 shiftpressed "$pkgdir/usr/bin/shiftpressed"
+}
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;
+}