Jump to content
Tankbuster

Key modifiers, shift, alt etc?

Recommended Posts

I feel a bit dumb asking such an elementary question but I'm rather hoping I'm not the only one struggling with this.

 

The shift, ctrl and alt modifier keys seem to be largely ignored by the game. For example, I'd like to shift ctrl f1 to ctrl f12 for other application, but the game still interprets ctrl f1 as f1 and selects the first unit in my squad.

 

Is there a way of having the game being able to tell the difference between ctrl f1 and f1?

Share this post


Link to post
Share on other sites

Apply locally via initPlayerLocal or other scirpt:

 

(findDisplay 46) displayAddEventHandler 
[
	"KeyDown",
	{
		params ["_ctrl", "_dikCode", "_shift", "_ctrlKey","_alt"];
 
		private _handled = false;
	 
		if (_ctrlKey && !_shift && !_alt && _dikCode == DIK_FI) then 
		{
			_handled = true;
		};
	 
		_handled;  
	}
];

 

Share this post


Link to post
Share on other sites

Thanks, John, but that didn't work. Ctrl F1 still bought up the group command menu.

Share this post


Link to post
Share on other sites

My bad, forgot to copy this over, lol, put the following above the original:

 

#define DIK_F1 0x3B

 

Share this post


Link to post
Share on other sites
#define DIK_F1 0x3B
(findDisplay 46) displayAddEventHandler
[
	"KeyDown",
	{
		params ["_ctrl", "_dikCode", "_shift", "_ctrlKey"];

		private _handled = false;

		if (_ctrlKey && _dikCode == DIK_FI) then
		{
			_handled = true;
		};

		_handled;
	}
];

Like this?

Share this post


Link to post
Share on other sites

Correct, see if that works, if it doesn't I'm not too sure why it wouldn't......but I've been out of the scripting game for some months now so....

Share this post


Link to post
Share on other sites

That didn't work either. :( Thanks for trying though mate. Appreciated.

Share this post


Link to post
Share on other sites

Looks like you guys already have the only way to override default engine behavior  

Quote

Returning true in EH code will override default engine handling for keyboard events. 

Is this some sort of bug? 

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

×