![]() |
getKeyClicked
Hi,
I have something like this: if (keyToAction(getKeyClicked)=GA_LEFT) then s:=1; if (keyToAction(getKeyClicked)=GA_DOWN) then s:=2; if (keyToAction(getKeyClicked)=GA_RIGHT) then s:=3; but it works only when i press 'left'. Nothing happens, when i press 'down' or 'right'. What's more interesting, if i disable the first one: {if (keyToAction(getKeyClicked)=GA_LEFT) then s:=1;} if (keyToAction(getKeyClicked)=GA_DOWN) then s:=2; if (keyToAction(getKeyClicked)=GA_RIGHT) then s:=3; then only 'down' works. Using 'else' instead of three separete "IFs" doesn't work as well. Everything is fine, when i use "getKeyPressed", instead of "getKeyClicked", but in this case i NEED "getKeyClicked". So.. any idea, how to solve this? Thanks |
Ответ: getKeyClicked
PHP код:
|
Ответ: getKeyClicked
var key:integer;
key:=getKeyClicked; if (keyToAction(key)=GA_LEFT) then s:=1; if (keyToAction(key)=GA_DOWN) then s:=2; if (keyToAction(key)=GA_RIGHT) then s:=3; |
Ответ: getKeyClicked
DIMMON4IK:
I already said that using 'else' instead of three separete "IFs" doesn't work as well. Thanks for trying anyway. Dj_Alex: Bulls' eye! It works :) Thx! |
Часовой пояс GMT +4, время: 00:35. |
vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot