void __fastcall TForm1::Timer2Timer(TObject *Sender) { if (KEYDOWN(32)) { Событие } } How to set a range in place of a single-key code?
void __fastcall TForm1::Timer2Timer(TObject *Sender) { if (KEYDOWN(32)) { Событие } } How to set a range in place of a single-key code?
What does KEYDOWN do? I did not find it in Google.
Now in the case: if you need a range, you can write an auxiliary function that runs through the entire range and performs a KEYDOWN check with each element of the range:
bool KeyDownRange(int start, int end) { for (int i = start; i <= end; i++) { if (KEYDOWN(i)) { return true; } } return false; } And then in your function:
void __fastcall TForm1::Timer2Timer(TObject *Sender) { if (KeDownRange(32, 64)) { Событие } } Source: https://ru.stackoverflow.com/questions/540503/
All Articles
if (KEYUP(32) | KEYUP(100) | KEYUP(122))? - KoVadim