Тема: getKeyClicked
Показать сообщение отдельно
Старый 27.09.2010, 18:32   #1
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
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
(Offline)
 
Ответить с цитированием