summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-12-29 16:32:13 -0500
committerknolax <1339802534.kk@gmail.com>2017-12-29 16:32:13 -0500
commitbdd082989e88809a0a049a270fae70d0ea8b6711 (patch)
tree4963ed32b39253c4af0de5757286d99ed610cbbf
parent42dd37ade1869064b3404ec8e62ca52c8e323985 (diff)
forgot to change update PHYS_STATE for every call of processkey, not jsut when there is a risng or falling edge.
-rw-r--r--skey.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/skey.c b/skey.c
index bc94680..c7cc4f8 100644
--- a/skey.c
+++ b/skey.c
@@ -170,14 +170,7 @@ int processkey(int row, int column, int state) {
}
//falling edge
- if ((KEYSTATE_PHYS & keystate[row][column]) && !state) {
- //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 ((KEYSTATE_PHYS & keystate[row][column]) && !state) {
if (!stickymode) {
//reports key up
input_report_key(skey_dev, skey_keymap[current_keymap][row][column], 0);
@@ -186,12 +179,6 @@ int processkey(int row, int column, int state) {
}
//rising edge
}else if (!(KEYSTATE_PHYS & keystate[row][column]) && state) {
- //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
@@ -276,6 +263,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;
}