How to modify Keyboard interrupt (under Windows XP) from a C++ Program ?
- by rockr90
Hi everyone !
We have been given a little project (As part of my OS course) to make a Windows program that modifies keyboard input, so that it transforms any lowercase character entered into an uppercase one (without using caps-lock) ! so when you type on the keyboard you'll see what you're typing transformed into uppercase !
I have done this quite easily using Turbo C by calling geninterrupt() and using variables _AH, _AL, i had to read a character using:
_AH = 0x07; // Reading a character without echo
geninterrupt(0x21); // Dos interrupt
Then to transform it into an Upercase letter i have to mask the 5th bit by using:
_AL = _AL & 0xDF; // Masking the entered character with 11011111
and then i will display the character using any output routine.
Now, this solution will only work under old C DOS compilers. But what we intend to do is to make a close or similar solution to this by using any modern C/C++ compiler under Windows XP ! What i have first thought of is modifying the Keyboard ISR so that it masks the fifth bit of any entered character to turn it uppercase ! But i do not know how exactly to do this. Second, I wanted to create a Win32 console program to either do the same solution (but to no avail) or make a windows-compatible solution, still i do not know which functions to use !
Third I thought to make a windows program that modifies the ISR directly to suit my needs ! and i'm still looking for how to do this !
So please, If you could help me out on this, I would greatly appreciate it !
Thank you in advance !
(I'm using Windows XP on intel X86 with mingw-GCC compiler.)