Witam. Piszę w C++ / Builder 10.2
Mam problem ze sterowaniem, gdy naciskam klawisz instrukcje zawarte nie wykonują się.
void __fastcall TForm3::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)
{
if (RG1->ItemIndex==0){
if (Key==0x25){ //LEFT
postac->Left-=30;}
if (Key==0x26){ //UP
postac->Top-=30;}
if (Key==0x27){ //RIGHT
postac->Left+=30;}
if (Key==0x28){ //DOWN
postac->Top+=30;}
}
if (RG1->ItemIndex==1){
if (Key==0x41){ //LEFT
postac->Left-=30;}
if (Key==0x57){ //UP
postac->Top-=30;}
if (Key==0x44){ //RIGHT
postac->Left+=30;}
if (Key==0x53){ //DOWN
postac->Top+=30;} //postac to image
}
}
A na przyszłość gdzie dawać takie ustawienia w OnKeyUp , OnKeyPress czy w OnKeyDown i w jakim elemencie?