To do multiple key presses you will have to write an interrupt handler for interrupt 09h. The default interrupt handler installed by the BIOS does not allow for multiple keystrokes. It places them in a circular buffer and then reads from the buffer. If the buffer overflows, it will beep. This is fine for normal use but absolutely horrible for games.
To track them now:
interrupt (*OldInt9Handler)(...) //use ... for C++ programs
if(keyhit & 0x80)
case 1: Keys[keyhit]=0;break;
case 0: Keys[keyhit]=1;break;
You cant use a switch statement because switch is for mutually exclusive items. In other words, after you find one item to be true, you do a break which then exits the switch altogether. If you don't break, then all of the next statements will execute until a break is encountered.
//key with scancode has been pressed
To install it:
To restore the IVT:
OldInt9Handler=getvect(0x09); //save current vector
setvect(0x09,MyInt9Handler); //install new one
setvect(0x09,OldInt9Handler); //restore vector to old one