summaryrefslogtreecommitdiff
path: root/evspy/evspy.h
diff options
context:
space:
mode:
authorGuillermo Ramos2011-08-28 20:41:48 +0200
committerGuillermo Ramos2011-08-28 20:41:48 +0200
commitd6b7634ce3b2fbc6f54a24196da61e584b9c758d (patch)
treeef0546c8e708722a06e2d4a56a98ba11d913b798 /evspy/evspy.h
parent6f073702304735317e0ca3844060cd55f30a2df6 (diff)
downloadlkm-d6b7634ce3b2fbc6f54a24196da61e584b9c758d.tar.gz
Evspy reconoce teclas especiales (altgr,tab,...)
Diffstat (limited to 'evspy/evspy.h')
-rw-r--r--evspy/evspy.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/evspy/evspy.h b/evspy/evspy.h
new file mode 100644
index 0000000..f140638
--- /dev/null
+++ b/evspy/evspy.h
@@ -0,0 +1,75 @@
+//#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define PROCNAME "driver/evspy2"
+#define BUFSIZE PAGE_SIZE
+#define MIN(x, y) (x) < (y) ? (x) : (y)
+
+#define incp(p) \
+({ \
+ if (p == &buffer[BUFSIZE-1]) \
+ p = buffer; \
+ else \
+ p++; \
+ p; \
+})
+
+#define ins(c) \
+({ \
+ *wrp = c; \
+ if (incp(wrp) == rdp) \
+ incp(rdp); \
+})
+
+#define isfX(c) \
+({ \
+ (c >= F1 && c <= F10) || (c == F11 || c == F12); \
+})
+
+#define EV_BLKMAYUS 17
+
+#define FREE 0
+#define PRESS 1
+#define HOLD 2
+
+#define ESC 1
+#define TAB 15
+#define LCTRL 29
+#define LMAYUS 42
+#define DOT 52
+#define RMAYUS 54
+#define ALT 56
+#define BLKMAYUS 58
+#define F1 59
+#define F10 68
+#define F11 87
+#define F12 88
+#define RCTRL 97
+#define ALTGR 100
+#define UP_AR 103
+#define DOWN_AR 108
+#define LEFT_AR 105
+#define RIGHT_AR 106
+
+static char map_es[] = {
+ '.', '.', '1', '2', '3', //0 // 1:ESC
+ '4', '5', '6', '7', '8', //5
+ '9', '0', '\'', '!', '\b', //10 // 13:¡ (NOASCII)
+ '.', 'q', 'w', 'e', 'r', //15 // 15:TAB
+ 't', 'y', 'u', 'i', 'o', //20
+ 'p', '`', '+', '\n', '.', //25 // 29:LCTRL
+ 'a', 's', 'd', 'f', 'g', //30
+ 'h', 'j', 'k', 'l', 'n', //35 // 39:ñ (NOASCII)
+ '\'', '.', '.', 'c', 'z', //40 // 42:LMAYUS 43:ç (NOASCII)
+ 'x', 'c', 'v', 'b', 'n', //45
+ 'm', ',', '.', '-', '.', //50 // 52:. 54:RMAYUS
+ '*', '.', ' ', '.', '.', //55 // 56:ALT 58:BLKMAYUS 59-68:F1-F10
+ '.', '.', '.', '.', '.', //60
+ '.', '.', '.', '.', '.', //65
+ '.', '7', '8', '9', '-', //70
+ '4', '5', '6', '+', '1', //75
+ '2', '3', '.', '.', '.', //80
+ '.', '<', '.', '.', '.', //85
+ '.', '.', '.', '.', '.', //90
+ '.', '\n', '.', '/', '.', //95 // 97:RCTRL
+ '.', '.', '.', '.', '.', //100 // 100:ALTGR 103:up_arrow
+ '.', '.', '.', '.', '.', //105 // 105:lft_arrow 106:rgt_arrow 108:down_arrow
+};