CapsLock(), InsMode(), NumLock()
These functions are really cool because they let you change the state of the user's keyboard programmatically. That's right—these functions let you turn the Caps Lock and Num Lock keys on and off and change from insert to overwrite mode and back. They also tell you the state of those items before you changed it.
Usage |
lReturnValue = CAPSLOCK( [ lNewState ] ) lReturnValue = INSMODE( [ lNewState ] ) lReturnValue = NUMLOCK( [ lNewState ] ) |
Parameter |
Value |
Meaning |
lNewState |
.T. |
Turn the setting on. |
.F. |
Turn the setting off. |
|
Omitted |
Don't change the setting. |
|
lReturnValue |
.T. |
The setting was on before calling the function. |
.F. |
The setting was off before calling the function. |
Perhaps most cool of all is that you can actually see the light on the keyboard go on or off for CAPSLOCK() and NUMLOCK(). |
Example |
* Switch to uppercase lOldCaps = CAPSLOCK(.T.) * now have user perform uppercase entry * now reset it CAPSLOCK(lOldCaps) * reverse the insert setting INSMODE(.NOT. INSMODE()) |
See Also |