Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Prophecy30

OnKeyPress Issues With Case

Recommended Posts

Hey, thanks for taking a look at my problem, and I will get right into it.

So this Works Perfectly Fine

waituntil {!isnull (finddisplay 46)};
(findDisplay 46) displaySetEventHandler ["KeyDown","_this call MY_KEYDOWN_FNC; false;"];  

MY_KEYDOWN_FNC = {
private ["_shift","_key", "_handled"];

_key = _this select 1;
_shift = _this select 2;
_handled = false;

if(!alive player) exitWith {_handled};
   switch (_key) do {       

       //Key B + Shift
        case 48: {
           if (_shift) then {
               createdialog "Actions_Menu";
           } else{
               //Do Nothing!
           };
       };

       _handled;
   };
};

But If I change the Case # to say 44 (Y) then it stops working?! I have tried restarting ArmA and going back in, but still nothing happens, when I change the case number back to 48, It works fine again?! Any Ideas?

waituntil {!isnull (finddisplay 46)};
(findDisplay 46) displaySetEventHandler ["KeyDown","_this call MY_KEYDOWN_FNC; false;"];  

MY_KEYDOWN_FNC = {
private ["_shift","_key", "_handled"];

_key = _this select 1;
_shift = _this select 2;
_handled = false;

if(!alive player) exitWith {_handled};
   switch (_key) do {       

       //Key Y + Shift
        case 44: {
           if (_shift) then {
               createdialog "Actions_Menu";
           } else{
               //Do Nothing!
           };
       };

       _handled;
   };
};

Also, i have been looking for a way to do multiple keys for KeyPress like Ctrl + LWindows key, how would I go about that?

Thankyou in advanced!

Share this post


Link to post
Share on other sites
Sign in to follow this  

×