From 74ed96bd35757bc4446c6f42ac48ae09638b5e72 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Fri, 16 Sep 2011 19:38:44 +0200 Subject: One file for each keyboard layout. Shift implemented on spanish layout --- evspy-core.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'evspy-core.c') diff --git a/evspy-core.c b/evspy-core.c index 0171b5b..5f84e83 100644 --- a/evspy-core.c +++ b/evspy-core.c @@ -20,23 +20,12 @@ * <0xwille@gmail.com> */ -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "evspy-core.h" -#include "khashmap/khashmap.h" static char *buffer; // circular buffer static char *rdp; // read pointer static char *wrp; // write pointer -static char *map = EVS_MAP; // current keyboard layout static unsigned short int capslock_state = EVS_VAL_FREE; static unsigned short int shift = 0; @@ -180,7 +169,7 @@ static void evspy_event(struct input_handle *handle, unsigned int type, if (code == KEY_CAPSLOCK && value == EVS_VAL_PRESS) { special_char(KEY_LEFTSHIFT, capslock_state); return; - } else if (type != EV_KEY || unlikely(code >= sizeof(EVS_MAP))) { + } else if (type != EV_KEY || unlikely(code >= sizeof(map))) { return; } @@ -191,7 +180,7 @@ static void evspy_event(struct input_handle *handle, unsigned int type, // "Direct" keys (alphanumeric + some symbols) } else if (value == EVS_VAL_PRESS) { if (shift) - evs_insert(evs_shift(map[code])); + evs_insert(evs_shift(code)); else evs_insert(map[code]); } @@ -254,6 +243,8 @@ static int __init evspy_init(void) { create_proc_read_entry(EVS_PROCNAME, 0, NULL, evspy_read_proc, NULL); + init_shiftmap(); + buffer = kmalloc(EVS_BUFSIZE, GFP_KERNEL); rdp = wrp = buffer; -- cgit v1.2.3