summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-12-29 17:25:23 -0500
committerknolax <1339802534.kk@gmail.com>2017-12-29 17:25:23 -0500
commit60c0a4dcd0ae35e057ed8dcaee86baf0a350e8c5 (patch)
tree3ed91d511728ad8b4de2c5898e1311c0ea0f117d
parent2182af81312ef1ca1876129642a4e599db275c3b (diff)
added more debug prints, it should be printing keycodes now, though i'm using %d with longs.
-rw-r--r--skey.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/skey.c b/skey.c
index c2693f8..906ed9d 100644
--- a/skey.c
+++ b/skey.c
@@ -176,6 +176,7 @@ int processkey(int row, int column, int state) {
if ((KEYSTATE_PHYS & keystate[row][column]) && !state) {
printk(KERN_INFO "skey: falling edge detected for r:%d,c:%d\n", row, column);
if (!stickymode) {
+ printk(KERN_INFO "skey: stickymode off with falling edge, reporting key up with keycode %d\n", skey_keymap[current_keymap][row][column]);
//reports key up
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 0);
input_sync(skey_dev);
@@ -190,25 +191,31 @@ int processkey(int row, int column, int state) {
*/
switch (skey_keymap[current_keymap][row][column]) {
case KEY_ALPHAMAP:
+ printk(KERN_INFO "skey: changing to keymap ALPHA\n");
current_keymap = 0;
return 0;
break;
case KEY_NUMBERMAP:
+ printk(KERN_INFO "skey: changing to keymap NUM\n");
current_keymap = 1;
return 0;
break;
case KEY_SPECIALMAP:
+ printk(KERN_INFO "skey: changing to keymap SPECIAL\n");
current_keymap = 2;
return 0;
break;
case KEY_STICKYMAP:
+ printk(KERN_INFO "skey: toggling stickymode\n");
stickymode = !stickymode;
if (!stickymode) {
clearkeystate();
+ printk(KERN_INFO "skey: cleaned stickmode states\n");
}
return 0;
break;
case KEY_MS_2ND:
+ printk(KERN_INFO "skey: toggling MS_2ND\n");
if (current_keymap == 2) {
current_keymap = 3;
} else if (current_keymap == 3) {
@@ -249,14 +256,17 @@ int processkey(int row, int column, int state) {
}
//if it's stickymode, toggle the state stored and send corresponding vent
if (stickymode) {
+ printk(KERN_INFO "skey: stickymoe on with rising edge\n");
//it was high before, so now it's being toggled off
if (keystate[row][column] & keystate_bitmask) {
+ printk(KERN_INFO "skey: stickymode sending key up with code %d\n", skey_keymap[current_keymap][row][column]);
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 0);
input_sync(skey_dev);
keystate[row][column] = (~keystate_bitmask) & keystate[row][column];
//it was low before, so now it's being toggled on
} else {
+ printk(KERN_INFO "skey: stickymode sending key down with code %d\n", skey_keymap[current_keymap][row][column]);
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 1);
input_sync(skey_dev);
keystate[row][column] = keystate_bitmask | keystate[row][column];
@@ -264,6 +274,7 @@ int processkey(int row, int column, int state) {
}
//otherwise just send a key down event
} else {
+ printk(KERN_INFO "skey:skey rising edge w/o stickymode, sending key down with keycode %d\n", skey_keymap[current_keymap][row][column]);
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 1);
input_sync(skey_dev);
}