Jump to content
phronk

How to get player's keybind?

Recommended Posts

This is for a client-side script.
Is there a way to get / detect the keybind the player is using for a specific control?  I'd imagine that if it is doable, then it'd involve something like this:

if ( isClass (configFile >> "CfgControls" >> "PushToTalk")) then {hint "Talking...";};

 

The above code is just a guess; CfgControls and PushToTalk do not exist as far as I've checked.  But if it's labelled as something else, that'd help me a lot.  I basically want the script to automatically pull the player's PushToTalk keybind and use it as a reference when executing the rest of the code.  So when the player presses his PushToTalk key, the hint will appear.  I need this because not all players use the same PushToTalk keybind.  Worst case scenario, I can have the player select/set the PushToTalk key from a scripted list of available keys, but I'd rather it be automatic for ease of access and simplicity.

 

Thanks!

Share this post


Link to post
Share on other sites
if ( inputAction "PushToTalk" > 0 ) then { hint "Talking"; };

inputAction

input Actions

  • Like 2

Share this post


Link to post
Share on other sites

You are a King of Kings.  Thank you.
Thread can be closed now.

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

×