Jump to content
gc8

Check for certain keys

Recommended Posts

Hi

I'm making a script where player has to press one button to rotate through objects and another button to place that object. The problem is how do I know to pick such buttons the player has not binded?

 

Or maybe I use the movement keys (default  wasd) but that might move the player and how do I know those are in fact player's movement keys?

 

thanks for any advice!

 

Share this post


Link to post
Share on other sites

If you have cba enabled you can use its setting system to define keys, if you do not want a dependency to cba you can use

https://community.bistudio.com/wiki/displayAddEventHandler

 

Share this post


Link to post
Share on other sites

@Mr H. Thanks , i'm using the EH. But I may still need some solution to check the player keybindings I guess.

 

Share this post


Link to post
Share on other sites

here's an example:

findDisplay 46 displayAddEventHandler ["KeyDown", 
{


if (inputAction "showMap" >0) then {call MRH_fnc_MilsimTools_EnhancedMap_openMapInputAction;};
}];

};

and here's the list of inputAction actions: https://community.bistudio.com/wiki/inputAction/actions

  • Thanks 1

Share this post


Link to post
Share on other sites

@Mr H. Thanks!  Think I have the right tools now :)

 

 

  • Haha 1

Share this post


Link to post
Share on other sites

Cough cough, another solution passing here.

I'd recommend using inputAction. Of course, it's up to you that which you want to use.

Share this post


Link to post
Share on other sites
3 minutes ago, POLPOX said:

Cough cough, another solution passing here.

I'd recommend using inputAction. Of course, it's up to you that which you want to use.

That's what i said ^^  look above

Share this post


Link to post
Share on other sites
1 hour ago, Mr H. said:

That's what i said ^^  look above

Oops, ignore that.

However, why are you using inputAction along with displayAddEventHandler? I have no idea, doesn't make sense.

 

EDIT: Damn my brain, it does make sense, just I'll take another solution to do it. My God, ignore this too.

  • Haha 2

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

×