How does XP detect the Caps lock state in Password fields?

  • Thread starter Thread starter DOSrelic
  • Start date Start date
D

DOSrelic

Can someone please give me guidance on this functionality please? Your
attention would be most gratefully received. lol
 
not sure why you want to know this ?
.... it does detect it...

or is it broken ?

if it is broken on your machine, then explain further, and give us more info
on when it doesn't work
 
Very simple, the program in question checks on the bit in
memory that is set when the keyboard's CapsLock key is
enabled. Each key on the keyboard is basically assigned an
area of memory that is either turned on or off by the
pressing of a key. Since the CapsLock, like the ScrollLock
and NumLock, are toggles, the bit is left on when the key
has been pressed once and turned off on a second key press.
The programmer knows where these addresses are located,
which were assigned by the programmer of the Operating
System, and can interrogate that bit for on or off status.
All other keys turn on its corresponding bit which the OS
turns off when it is interrogated by the OS. Everything is
controlled by things called interrupts. Every keypress
triggers an interrupt that lets the system's OS know that
"hey, a key has been pressed, lets find out which one" then
control of that keypress is turned over to the program that
is currently running. The mouse, modem, NIC or any other
device when requesting service from the computer also sends
interrupt signals to the computer.

Hope this answers your question (in very simplified terms),
let us know.
 
Dear Edwin vMierlo <[email protected]>
thanks for the interest and yes mine does work as expected but I would like
to use the detection ability in my own Visual Studio 2005 C++ programs so
need to know the most expedient way that uses the least of system resources
in order to do this with the most efficiency. lol
Thanks "LVTravel". Very informative but because I am a DOS relic I really
need to know how to query that specific bit so that I too can become "The
programmer knows where these addresses are located, which were assigned by
the programmer of the Operating System,"
Where might I find this information or can someone please tell me what
function I can use as a 'hook' to catch any changes to that bit? Cheers ®
 
You might do a Google search for information that you seek,
but, I don't know how much help it will be. I haven't done
it yet. I too am a DOS relic that has graduated to Win XP.
I could do that back in the days of Turbo Basic, Fortran and
Cobol on the earlier mainframe and PC systems. There may
also be available information in a good C++ programming book
for Visual Studio. Most of the older books had information
for programming languages that could get down to the level
of the OS. Hopefully newer ones do also. Look for
information on interrupt sensing, keyboard address mapping
and the like.

Hope this helps. Me, I learning PowerPoint programming.
Visual Basic again.
 
NET Framework Class Library
Console.CapsLock Property
Note: This property is new in the .NET Framework version 2.0.

Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on
or turned off.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

C++
public:
static property bool CapsLock {
bool get ();
}


here is the link
http://msdn2.microsoft.com/en-us/library/system.console.capslock(VS.80).aspx

TIP: www.google.com is your friend... I found all that by a simple google
query.

HTH,

Edwin.
 
DOSrelic said:
Dear Edwin vMierlo <[email protected]>
thanks for the interest and yes mine does work as expected but I would like
to use the detection ability in my own Visual Studio 2005 C++ programs

A question for a programmers group... Anyway, have a look
at GetKeyboardState and VK_CAPITAL.


Uwe
 
Hi LV, yes google is damn good if you know exactly what to search for,
getting closer though thanks.
Edwin. I appreciate your input but I don't really want to rely on servers as
the people I am targeting don't live on the net!
Hi Uwe, A question for a programmers group... probably but it seems more to
do with the operating system as that ability doesn't exist in earlier
versions (that I know of) and with all your guys' responses the search is
becoming narrower and more fruitful!
I think I may have now found the perfect place to assist me in this and
other areas of naiveté cheers guys. lol
http://www.codeproject.com/cpp/togglekeys.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top