X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Fkeyb.c;h=36a6021a8e288cfcf115f6916d14bad0fd37dfb3;hp=98a1f3da20ee0a7cb3c16f63f90fa63a6c256e92;hb=6819a099c49a569221321a46a52811aead65d20e;hpb=efaf4df9a6d3fed46b7ef7f568eb47e43c16462e diff --git a/src/dos/keyb.c b/src/dos/keyb.c index 98a1f3d..36a6021 100644 --- a/src/dos/keyb.c +++ b/src/dos/keyb.c @@ -20,6 +20,7 @@ along with the program. If not, see #include #include #include +#include #include #include @@ -138,6 +139,10 @@ int kb_isdown(int key) case KB_CTRL: return keystate[KB_LCTRL] + keystate[KB_RCTRL]; } + + if(isalpha(key)) { + key = tolower(key); + } return keystate[key]; } @@ -206,7 +211,7 @@ void kb_putback(int key) static void INTERRUPT kbintr() { unsigned char code; - int key, press; + int key, c, press; code = inp(KB_PORT); @@ -224,12 +229,13 @@ static void INTERRUPT kbintr() } key = scantbl[code]; + c = (keystate[KB_LSHIFT] | keystate[KB_RSHIFT]) ? scantbl_shift[code] : key; if(press) { /* append to buffer */ - last_key = key; + last_key = c; if(buffer_size > 0) { - buffer[buf_widx] = key; + buffer[buf_widx] = c; ADVANCE(buf_widx); /* if the write end overtook the read end, advance the read end * too, to discard the oldest keypress from the buffer