سؤال

I have this procedure and I get it's called when I press a key, and something else will happen when Key = 17, how can I know which key is it?

procedure TFormPrincipal.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
 begin
  if Key = 17 then
    Seventeen:= true;
 end;
هل كانت مفيدة؟

المحلول

"Key" refers to the VirtualKeyCode of the key. 17 equals to VK_CONTROL, either of your CTRL keys. Check this list for reference.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top