fixes in the get_key() functions; svgalib_drv.c instrumented with debugging code

This commit is contained in:
marschap
2005-07-03 12:20:24 +00:00
parent f0386c7eef
commit ca7b9f3f45
4 changed files with 112 additions and 104 deletions
+16 -13
View File
@@ -1230,12 +1230,10 @@ MtxOrb_icon (Driver *drvthis, int x, int y, int icon)
* Otherwise crash of the LCD and/or I2C bus.
*
******************************
* returns one character from the keypad...
* returns a string for the function characters from the keypad...
* (A-Z) on success, 0 on failure...
*/
/* TODO implement for new API call (get_key) that returns a string */
/*
* Return one char from the KeyRing
*/
@@ -1263,19 +1261,24 @@ MtxOrb_get_key (Driver *drvthis)
}
if (!p->keypad_test_mode) {
if (in==p->left_key) { return "Left";
} else if (in==p->right_key) { return "Right";
} else if (in==p->up_key) { return "Up";
} else if (in==p->down_key) { return "Down";
} else if (in==p->enter_key) { return "Enter";
} else if (in==p->escape_key) { return "Escape";
} else {
report( RPT_INFO, "MtxOrb Untreated key 0x%2x", in);
if (in == p->left_key)
return "Left";
else if (in == p->right_key)
return "Right";
else if (in == p->up_key)
return "Up";
else if (in == p->down_key)
return "Down";
else if (in == p->enter_key)
return "Enter";
else if (in == p->escape_key)
return "Escape";
else {
report( RPT_INFO, "MtxOrb Untreated key 0x%2x", in);
return NULL;
}
}
} else {
fprintf (stdout, "MtxOrb: Received character %c\n", in);
in = 0;
fprintf (stdout, "MtxOrb: Press another key of your device.\n");
}
return NULL;