Jump to content
das attorney

Toggle inventory - for TAB users

Recommended Posts

I use tab for open inventory button, but it's always bothered me that you can't use the same button to close it; instead you have to use Esc or the X button in the corner of the inventory.

 

Here is some code so you can have a button that opens the inventory, and the same button closes it.

 

Put it in initPlayerLocal.sqf or similar.

 

Enjoy

 

player addEventHandler ["InventoryOpened",{
    _this spawn {
        waitUntil {
            not isNull (findDisplay 602)
        };
        INVCLOSED = (findDisplay 602) displayAddEventHandler ["keydown", {
            if ((_this select 1) in (actionKeys "gear")) then {
                (findDisplay 602) displayRemoveEventHandler ["keydown",INVCLOSED];
                closeDialog 0
            }
        }]
    }
}]

 

  • Like 4

Share this post


Link to post
Share on other sites

DayZ style.....I like it!

  • Like 2

Share this post


Link to post
Share on other sites
24 minutes ago, Evil Organ said:

DayZ style

 

 

Indeed!  I was playing a lot over the weekend because it doesn't completely suck anymore and enjoying the toggle inv.  Then I went back to Arma today and was like "ugh".

  • Like 1

Share this post


Link to post
Share on other sites

Alphanumeric and non-"navigation" keys work fine. Tab, page-up/down, arrow keys exhibit the behavior you describe..

Share this post


Link to post
Share on other sites
4 hours ago, das attorney said:

Here is some code so you can have a button that opens the inventory, and the same button closes it.

It's specifically because you are using TAB and the inventory has a tab order, any special keys PgUP arrows etc will move focus around the inventories UI elements.

Most other buttons if there is no conflict will both open and close the inventory.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Larrow said:

It's specifically because you are using TAB and the inventory has a tab order, any special keys PgUP arrows etc will move focus around the inventories UI elements.

Most other buttons if there is no conflict will both open and close the inventory.

 

Yes, I realised that so I wrote this script for me any any other people using tab

Share this post


Link to post
Share on other sites
5 minutes ago, das attorney said:

 

Yes, I realised that so I wrote this script for me any any other people using tab

Cool no worries, just was not sure from your description it was clear that you realised this.

Share this post


Link to post
Share on other sites

Ah ok - I put it in the first sentence of the preamble.  Let me see if I can modify the topic description..

 

edit: That was pretty painless - done  :)

Share this post


Link to post
Share on other sites

Toggle Inventory - for reserved keys

Quote

Here is some code so you can have a reserved button ( reserved for UI navigation TAB, PgUP/DOWN, Home etc, Arrow keys ) that opens the inventory, and will also close it.

 

I know being pedantic but I've nothing better to do on a Sunday night :smile_o:, actually fuck it, I'll behave and go play some Tetris with my EfT inventory instead. :wink_o:

  • Like 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

×