Reputation: 35
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.)
Upvotes: 1
Views: 2856
Reputation: 942050
How soon do you plan to graduate? Hopefully you'll have time, Windows doesn't work this way anymore. You'll need to write a keyboard filter driver using the WDK. It comes with a sample implementation in the src\input\kbfiltr directory. You can't use the tools you're familiar with, the WDK includes a compiler and a kernel debugger. Available at no cost, go here to get started.
Upvotes: 1
Reputation: 18984
You can't get access to the Keyboard ISR unless you write a Ring 0 device driver. You are better off investigating the Windows Hook APIs. These accomplish the same thing.
Start here: http://msdn.microsoft.com/en-us/library/ms644990%28v=VS.85%29.aspx
Upvotes: 2