March 28, 2024, 05:51:19 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


detect the state of Insert key

Started by Haim, August 22, 2009, 08:18:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haim

Hello all,
How can I tell whetehr the keyboard is in insert or replace mode.
Getkeystate only report the press of the key but not the actual state.

Thanks for any help.
Haim

SnarlingSheep

GetKeyState also returns the state of toggle keys like Caps Lock in the low-order bit, but is Insert a toggle key?
Quote
The return value specifies the status of the specified virtual key, as follows:
If the high-order bit is 1, the key is down; otherwise, it is up.
If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0.

Haim

When I press the insert key I get a result in which bit 0 is 1. On subsequent calls to getkeystate (without additional key presses the result is 0, and the toggle state is not known