Button Box Project help with one thing and an advice on another

So I'm putting togheter an button box and this is actually my first project ever with an arduino but I feel like i'v understood enough tho since im not doing the ordinary way with push buttons I have had to think some more to be honest :).

Anyway im using toogle buttons as you might understand and what i was wondering (havn't found any answer about it really) is if there's a way for me to program that when i Toggle the button On it acts like a push button but and when i Toggle the button Off it would act like a second push button.

For instance let's say i press the button to turn on Headlights on my truck in Euro Truck Simulator, then the button should function as if it just pressed a button on a keyboard (but the button i pressed should still be in the Toggle On mode). And when I want to turn the Headlights Off I click the button to Off position and it registers it as a new button click. Aka "if Pressed: do this; if Released: do this;" I just havn't figured out or found anywhere on how to do that or if its even possible?

and for the advice, seeing im doing it with toggle switches I'm in need of two Leonardos and im curious if i should connect them as Master and slave or just as two seperate controllers. And also which of these schematics for the buttons that would be the most appropriate to use:

Color Scheme Button Box:

Yellow = GND
Orange = Potentiometers
Black = toggle buttons with a very dim LED
Purple = Pull-out Switches (like the american styled trucks parking brakes)
Brown = Push button
Blue = Flip switch with On/Off/On
Pink = Ignition Key

color scheme for the Bodacius (i didn't name it xD):

Black = Toggle Button
Orange Leftside = potentiometers
Orange Rightside = Igniton key
Yellow = Ground
Brow = On/Off/On Switch
Blue = Push-button
Purple = Pull-out Button

Would really love some help and feedback Yours Sincere Aarturius

There are many ways that you do not need 2 boards for this.

Buttons can be wired in matrix. 5 rows, 5 columns, 10 pins do 25 buttons. It does take an extra diode per button but worth it.

There are chips called shift registers and their better cousins port expanders and led drivers. We call them "pin multipliers".

Buttons can be wired to input shift register chips and read through SPI that uses 4 IO pins for all the added pins you want.

Leds can be wired to output shift registers on the same SPI daisy-chain that the input registers are on and read input bits in the same cycles that it sends bits out to light the leds.

I already tried doing a Matrix and since im using Toggle Buttons and not Push buttons it will press that button at the same time if i use one of the other buttons connected to that one on the secondary pin.

I.E. I connect pin 6 and 13 to one and then pin 7 and 13, when i push the first toggle to on with a software in the background to emulate a button press and i press the second with pin 7 and 13 then pin 6 and 13 will light up again (using a software atm for emulating what i wonderd if was programable.

If i understand it correctly a diode would not hinder the current from jumping from pin 7 to 6 cause it only changes the backflow cause it needs a current to register forward. And then it wouldn't do anything else than taking more power.

And only way for me to get extenders is from another country, i can get the shift register chips tho none of them have HID support. The Leds ain't a problem the demand so little light (inside the button) that they're working with just ground and 5 V without overheating or anything. So what i can get a hold of and would be the easiest and fastest is a second leonardo card.

If I understand your toggle switch question, I believe the answer is "yes."

const byte pinSwitch = 2;
byte
    lastSwitch;
    
void setup()
{
    pinMode( pinSwitch, INPUT_PULLUP );
    lastSwitch = digitalRead( pinSwitch );
    
}//setup

void loop()
{
    byte
        currSwitch;
        
    currSwitch = digitalRead( pinSwitch );
    if( currSwitch != lastSwitch )
    {
        if( currSwitch == LOW )
        {
            //do one thing
            
        }//if
        else
        {
            //do other thing
            
        }//else

        lastSwitch = currSwitch;
        
    }//if
    
}//loop

But I've probably misunderstood what you're trying to do.

Blackfin:
If I understand your toggle switch question, I believe the answer is "yes."

const byte pinSwitch = 2;

byte
    lastSwitch;
   
void setup()
{
    pinMode( pinSwitch, INPUT_PULLUP );
    lastSwitch = digitalRead( pinSwitch );
   
}//setup

void loop()
{
    byte
        currSwitch;
       
    currSwitch = digitalRead( pinSwitch );
    if( currSwitch != lastSwitch )
    {
        if( currSwitch == LOW )
        {
            //do one thing
           
        }//if
        else
        {
            //do other thing
           
        }//else

lastSwitch = currSwitch;
       
    }//if
   
}//loop




But I've probably misunderstood what you're trying to do.

Thats nearly what i needed it to do but i think i can work with that tbh if i put in an if statement to break the button press after 200 MS on both...

Aarturius:
I already tried doing a Matrix and since im using Toggle Buttons and not Push buttons it will press that button at the same time if i use one of the other buttons connected to that one on the secondary pin.

If you wire it up like that, yes. I assume that the buttons don't come with secondary pins connected to others. But if the toggle switch is wired so that it acts as a pushbutton (that you make toggle in software anyway) then it can work.

And only way for me to get extenders is from another country,

No eBay? Can't buy from Hong Kong?

i can get the shift register chips tho none of them have HID support.

Are those HID toggle switches? WHY are you dragging HID that has nothing to do with buttons into this?

Do what you want. I can't help you.

If the toggle has 2 outputs and 1 is always HIGH while the other is LOW then you only need to connect one of those to know what both present.

PS -- we haven't gotten to button bounce yet either.

Aarturius:
Thats nearly what i needed it to do but i think i can work with that tbh if i put in an if statement to break the button press after 200 MS on both...

Why would you need to "break" the button after 200mS? The logic operates on change of state; the change from low-to-high or high-to-low is what causes the relevant action to be executed.