By default, INKEY( ) doesn't detect a mouse click. To check for a mouse click, include M in <expC>. If M is included in <expC>, INKEY( ) returns the value 151 for a
single mouse click. Refer to the second example below to see how you can check for a double click.
INKEY( ) returns 0 if a key isn't pressed. If there are several keys in the typeahead buffer, the value of the first key entered in the buffer is returned.
Parameters
<expN>
<expN> specifies how many seconds INKEY( ) waits for a keystroke. If <expN> isn't included, INKEY( ) immediately returns a value for a keystroke. INKEY( ) waits
indefinitely for a keystroke if <expN> is 0.
<expC>
Include <expC> to show or hide the cursor or check for a mouse click. To show the cursor, include S in <expC>. To hide the cursor, include H in <expC>. If both S
and H are included in <expC>, the last character in <expC> takes precedence.
To check for a mouse click and show the cursor, include both M and S. To check for a mouse click and hide the cursor, include H and M.
When a keyboard macro is assigned to a key or key combination, you can include E in <expC> to expand the keyboard macro. When E is included, INKEY( )
returns a value corresponding to the first keystroke assigned to the keyboard macro. You can return successive values for each keystroke in a macro by
repeatedly executing INKEY( ) with E included. If E is not included, INKEY( ) returns the value for the key or key combination that triggers the keyboard macro.
Any characters besides H, M, S and E in <expC> are ignored.
Bob Palmer
The most common solution is H2O!