Page MenuHomeFeedback Tracker

DIK-codes from joysticks don't work in third-party addons
New, WishlistPublic

Description

Using scripting I've identified the DIK-codes for my Thrustmaster Warthog HOTAS system. I'm trying to bind various buttons to operate the radios in Task Force Arrowhead Radio, but when I do, nothing happens. I can bind using anything on the keyboard but no buttons on either throttle or stick work.
I can bind these buttons to "official" Arma functions (shooting, reload, leaning etc.) but not to addon functions.

The DIK-codes in question are 131842-45 and 131850-51.

Details

Legacy ID
1475094786
Severity
None
Resolution
Open
Reproducibility
Always
Category
Controls
Steps To Reproduce

Run the following script in the editor:

(findDisplay 46) displayAddEventhandler ["keyDown", {hint str (_this select 2)}];

Push buttons on the keyboard and watch how the hint pops up.
Push buttons on a joystick and watch how NOTHING happens.

Event Timeline

SnorreSelmer edited Additional Information. (Show Details)
SnorreSelmer set Category to Controls.
SnorreSelmer set Reproducibility to Always.
SnorreSelmer set Severity to None.
SnorreSelmer set Resolution to Open.
SnorreSelmer set Legacy ID to 1475094786.May 7 2016, 7:33 PM
SnorreSelmer added a subscriber: SnorreSelmer.

Using actionKeys proves that the buttons on my joystick and throttle have DIK-codes, but the event handler keysDown only handles keyboard buttons. If you look at this post I made on Armaholic it should hopefully explain better what I intend to achieve (http://www.armaholic.com/forums.php?m=posts&id=171357). I realize there is probably a code-change needed for TFAR to make it all work (not your table), but at least if I can do the grunt-work then it's easier for the author to fix.

I've found a reference to the event handler onJoystickButton that is available in VBS2 (https://resources.bisimulations.com/w/index.php?title=VBS2:_User_Interface_Event_Handlers) but despite a lot of searching I can't find an equivalent in Arma 3.

Hi, try this

(findDisplay 46) displayAddEventhandler ["mouseButtonClick", {hint str _this}];

source ( http://www.armaholic.com/forums.php?m=posts&id=171370 )