aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-03-13 12:37:46 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-03-13 12:37:46 +0000
commit3fe74144bf1b5b43256dcc33640bb2293d86202d (patch)
tree8db17f83420117878d9991ecffa0d6c52a71b4e9
parentb1255305ba273338be5e19fa5b3e34bd5ca820e1 (diff)
downloadlcd4linux-3fe74144bf1b5b43256dcc33640bb2293d86202d.tar.gz
Crystalfontz keypad patch from kenson
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@780 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--drv_Crystalfontz.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c
index 7372ac3..3854ce1 100644
--- a/drv_Crystalfontz.c
+++ b/drv_Crystalfontz.c
@@ -104,7 +104,7 @@ typedef struct {
static MODEL Models[] = {
{626, "626", 2, 16, 0, 0, 1, 0},
- {631, "631", 2, 20, 0, 0, 3, 22},
+ {631, "631", 2, 20, 4, 0, 3, 22},
{632, "632", 2, 16, 0, 0, 1, 0},
{633, "633", 2, 16, 4, 4, 2, 18},
{634, "634", 4, 20, 0, 0, 1, 0},
@@ -531,35 +531,53 @@ static int drv_CF_keypad(const int num)
case 2:
break;
case 3:
- if (num < 8)
+ if ((num < 8) || ((num > 12) && (num < 17)))
val = WIDGET_KEY_PRESSED;
else
val = WIDGET_KEY_RELEASED;
switch (num) {
case 1:
- case 8:
+ case 7:
val += WIDGET_KEY_UP;
break;
case 2:
- case 9:
+ case 8:
val += WIDGET_KEY_DOWN;
break;
case 3:
- case 10:
+ case 9:
val += WIDGET_KEY_LEFT;
break;
case 4:
- case 11:
+ case 10:
val += WIDGET_KEY_RIGHT;
break;
case 5:
- case 12:
+ case 11:
val += WIDGET_KEY_CONFIRM;
break;
- case 7:
- case 13:
+ case 6:
+ case 12:
val += WIDGET_KEY_CANCEL;
break;
+
+ /* added for 631, too lazy to make new WIDGET_KEY defines */
+ case 13:
+ case 17:
+ val += WIDGET_KEY_UP; /* really UPLEFT */
+ break;
+ case 14:
+ case 18:
+ val += WIDGET_KEY_RIGHT; /* really UPRIGHT */
+ break;
+ case 15:
+ case 19:
+ val += WIDGET_KEY_LEFT; /* really DOWNLEFT */
+ break;
+ case 16:
+ case 20:
+ val += WIDGET_KEY_DOWN; /* really DOWNRIGHT */
+ break;
}
break;
}