May 23, 2019, 07:01:06 am

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


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