John Kozak 14 Posted April 6, 2013 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
Igitur 43 Posted April 6, 2013 "TurnLeft" and "TurnRight" instead of "MoveLeft/Right"; Share this post Link to post Share on other sites
John Kozak 14 Posted April 6, 2013 Huh. That worked, thank you very much. Share this post Link to post Share on other sites