summaryrefslogtreecommitdiff
path: root/skey.c
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-12-29 16:44:26 -0500
committerknolax <1339802534.kk@gmail.com>2017-12-29 16:44:26 -0500
commit2182af81312ef1ca1876129642a4e599db275c3b (patch)
tree2a6c2bacf79468f1e0d468ac0feee994025c58c7 /skey.c
parent59fd478be4d6a7a20b327fe2cf7117e99f16bd6e (diff)
parent36b860a271be5885ae2608b9b703f73f0440844f (diff)
Merge branch 'reverse' into debug
Diffstat (limited to 'skey.c')
-rw-r--r--skey.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/skey.c b/skey.c
index 0bd4251..c2693f8 100644
--- a/skey.c
+++ b/skey.c
@@ -169,17 +169,12 @@ int processkey(int row, int column, int state) {
return -EINVAL;
break;
}
- printk("skey: previous KEYSTATE_PHYS for r:%d,c:%d was %d\n", row, column, (KEYSTATE_PHYS & keystate[row][column]));
+ if ((KEYSTATE_PHYS & keystate[row][column])) {
+ printk(KERN_INFO "skey: previous KEYSTATE_PHYS for r:%d,c:%d was %d\n", row, column, (KEYSTATE_PHYS & keystate[row][column]));
+ }
//falling edge
if ((KEYSTATE_PHYS & keystate[row][column]) && !state) {
printk(KERN_INFO "skey: falling edge detected for r:%d,c:%d\n", row, column);
- //after the previous keystate is checked, it is updated
- if (state) {
- keystate[row][column] = KEYSTATE_PHYS | keystate[row][column];
- } else {
- keystate[row][column] = (~KEYSTATE_PHYS) & keystate[row][column];
- }
-
if (!stickymode) {
//reports key up
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 0);
@@ -189,12 +184,6 @@ int processkey(int row, int column, int state) {
//rising edge
}else if (!(KEYSTATE_PHYS & keystate[row][column]) && state) {
printk(KERN_INFO "skey: rising edge detected for r:%d,c:%d\n", row, column);
- //after the previous keystate is checked, it is updated
- if (state) {
- keystate[row][column] = KEYSTATE_PHYS | keystate[row][column];
- } else {
- keystate[row][column] = (~KEYSTATE_PHYS) & keystate[row][column];
- }
/*
*handles keys that have special behavior, and to which stickykey do not apply
* if sticky keys don't apply then only the falling edge applies
@@ -279,6 +268,12 @@ int processkey(int row, int column, int state) {
input_sync(skey_dev);
}
}
+ //after the previous keystate is checked, it is updated
+ if (state) {
+ keystate[row][column] = KEYSTATE_PHYS | keystate[row][column];
+ } else {
+ keystate[row][column] = (~KEYSTATE_PHYS) & keystate[row][column];
+ }
return 0;
}