Jump to content
Sign in to follow this  
John Kozak

actionKeys question - MoveLeft/MoveRight not working?

Recommended Posts

Hi,

I'm trying to make use of actionKey handler (thanks to Defunkt for code), however, I've run into unexpected issue. For some reason, actions MoveForward and MoveBack work, however, MoveLeft and MoveRight are not recognized.

Example code:

_kdeh = -1;

while { _kdeh == -1 } do {

_kdeh = FindDisplay 46 DisplayAddEventHandler["KeyDown", "_this call keypress_hook"];

};

keypress_hook = {

_code = _this select 1;

_done = false;

if (_code in ActionKeys "User15") then {

hint "User15";

_done = true;

};

if (_code in ActionKeys "MoveForward") then {

hint "MoveForward";

_done = true;

};

if (_code in ActionKeys "MoveBack") then {

hint "MoveBack";

_done = true;

};

if (_code in ActionKeys "MoveLeft") then {

hint "MoveLeft";

_done = true;

};

if (_code in ActionKeys "MoveRight") then {

hint "MoveRight";

_done = true;

};

_done;

};

(needs to be pu in an SQF and launched in init.sqf or init field of some object)

When pressing W/S the hints appear, and the player does not move, as expected. When pressing A/D, however, the hook seems to ignore what was pressed. Does anyone have any idea on why that might happen?

Share this post


Link to post
Share on other sites

"TurnLeft" and "TurnRight" instead of "MoveLeft/Right";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×