BACKSPACE key not working
Brought to you by:
anarkavre
When you hit [BACKSPACE] it doesn't delete the last character because the unicode for the key is not being checked. Here is a possible solution for this, please review it (see files attached):
keyboard.c
...
if (tmp >= 0x61 && tmp <= 0x7A)
tmp &= 0x5F;
// Backspace
if (tmp == 0x08)
tmp = 0x5F;
if (tmp < 0x60)
{
writeKbd((unsigned char)(tmp | 0x80));
writeKbdCr(0xA7);
}
...
screen.c
...
switch (tmp)
{
case 0x0D:
indexX = 0;
indexY++;
break;
case 0x5F:
// Backspace
if (indexX > 0)
indexX--;
else
{
indexY--;
indexX = 39;
}
screenTbl[indexY * 40 + indexX] = 0x20;
default:
// Everything else
if (tmp >= 0x20 && tmp < 0x5F)
{
screenTbl[indexY * 40 + indexX] = tmp;
indexX++;
}
break;
}
...
Thank you for your work!