<p style="padding:0 0 0 0; margin:0 0 0 0;">Hi,</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">when you press CTRL+Q you will obtain two OnKeyDown events. The first with Key=17 (it is CTRL) and the second with Key=81 (Q). Both events will have ssCtrl in Shift.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">V.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Jürgen Hestermann <juergen.hestermann@gmx.de><br />
> Komu: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org><br />
> Datum: 08.02.2017 22:12<br />
> Předmět: [fpc-pascal] KeyDown routine and Ctrl+Q<br />
></p>
I use a KEYDOWN routine in my main TFORM to check for the key Ctrl+Q:<br />
<br />
-----------------------------------------------------------------<br />
procedure TForm1.FormKeyDown(Sender : TObject;<br />
var Key : Word;<br />
Shift : TShiftState);<br />
begin // TForm1.FormKeyDown<br />
case key of<br />
VK_Q :<br />
begin<br />
if Shift=[ssCtrl] then<br />
begin<br />
....<br />
-----------------------------------------------------------------<br />
<br />
But when I type "Ctrl+Q" then "Key" is 17 instead of VK_Q (81).<br />
<br />
If I now use 17 to trigger the "Q" key, then it is also triggered<br />
when I just type the Ctrl-key (without any other key)!<br />
<br />
This is all a bit weird.<br />
How can I detect that "Ctrl+Q" is pressed without<br />
getting fooled by any other key?<br />
<br />
_______________________________________________<br />
fpc-pascal maillist - fpc-pascal@lists.freepascal.org<br />
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br />