First post, by Og
- Rank
- Member
I'm really sorry about the off topic, but I just don't know where to go 😢
Seeing that there are so many talented DOS programmers here I hope someone can help me with this problem:
I'm running a TSR in DOSBox which preforms a certain function when the right Alt+Shift keys are pressed. The problem is, I need to do that via a batch file and not actually pressing the keyboard.
After MANY LONG hours googling, I finally found a piece of code which toggles the numlock key and modified it so it would turn on bit 0(LSB) of the Keyboard Status Flag Byte 0(Right Shift) and bit 3 of the Keyboard Status Flag Byte 3(Right Alt).
Here is the code:
void Rshift()
{
char far *kbds0 = (char far*)0x00400017UL;
*kbds0 |= 1;
}
void Ralt()
{
char far *kbds3 = (char far*)0x00400096UL;
*kbds3 |=8;
}
void main()
{
Rshift();
Ralt();
}
The shift part actually works, so if I run the program whatever I type is in CAPS, but for the life of me I can't figure out why doesn't the ALT part work 😖
I am pretty sure it's my code that's at fault and not DOSBox, can anyone tell me what have I done wrong?
Og