/* if there is a active mode, leave this first */
if (vb.mode->leave) {
- PRINT_DEBUG("leave %c", vb.mode->id);
vb.mode->leave();
}
}
vb.mode = new;
/* call enter only if the new mode isn't the current mode */
if (new->enter) {
- PRINT_DEBUG("enter %c", new->id);
new->enter();
}
res = vb.mode->keypress(key);
if (vb.mode) {
PRINT_DEBUG(
- "%c: key[0x%x %c] flags[%d] >> %c: flags[%d]",
- id, key, (key >= 0x20 && key <= 0x7e) ? key : ' ',
- flags, vb.mode->id, vb.mode->flags
+ "%c[%d]: %#.2x '%c' -> %c[%d]",
+ id - ' ', flags, key, (key >= 0x20 && key <= 0x7e) ? key : ' ',
+ vb.mode->id - ' ', vb.mode->flags
);
}
return res;