[AD] Shift+tab in edit boxes |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Here is a small diff that makes shift+tab in an editbox select previous
object in a dialog, rather than printing a ~.
Sven Sandberg
--- all3924\src\guiproc.c Mon Jul 19 20:59:42 1999
+++ allegro\src\guiproc.c Sun Jul 25 13:59:50 1999
@@ -555,8 +555,9 @@
* position within the string.
*/
int d_edit_proc(int msg, DIALOG *d, int c)
{
+ static int ignore_next_uchar = FALSE;
int f, l, p, w, x, fg, b, scroll;
char buf[16];
char *s;
@@ -683,9 +684,14 @@
}
else
return D_O_K;
}
+ else if ((c >> 8) == KEY_TAB) {
+ ignore_next_uchar = TRUE;
+ return D_O_K;
+ }
else {
+ ignore_next_uchar = FALSE;
/* don't process regular keys here: MSG_UCHAR will do that */
break;
}
scare_mouse();
@@ -693,9 +699,9 @@
unscare_mouse();
return D_USED_CHAR;
case MSG_UCHAR:
- if ((c >= ' ') && (uisok(c))) {
+ if ((!ignore_next_uchar) && (c >= ' ') && (uisok(c))) {
if (l < d->d1) {
uinsert(s, d->d2, c);
d->d2++;