[SOLVED]Trying to write a code for a Macro Keyboard of sorts

This project attempts to make a pedal board with 4 footswitches that perform macros that can be used by LiveSplit to perform actions. The combination of buttons used is slightly irrelevant, as LiveSplit can be configured to use any key, or combination of keys, for any specific function.

I have no coding background whatsoever, and I am attempting to learn this as I go. The following is the code I have written for the project. I have written this code by adapting code used in Examples provided by the ArduinoIDE.

#include "keyboard.h"


void setup() {
  // put your setup code here, to run once:
pinMode(3, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
Keyboard.begin();
}

void loop() {
  // put your main code here, to run repeatedly:
while (digitalRead(3)==HIGH) {
  delay(500);
}
if (digitalRead(3)==LOW){
 Keyboard.press(KEY_RIGHT_CTRL);
 Keyboard.press(KEY_RIGHT_SHIFT);
 Keyboard.press(89);
 delay(100);
 Keyboard.releaseAll();
 }

if (digitalRead(5)==LOW){
 Keyboard.press(KEY_RIGHT_CTRL);
 Keyboard.press(KEY_RIGHT_SHIFT);
 Keyboard.press(90);
 delay(100);
 Keyboard.releaseAll();
 }

 while (digitalRead(7)==HIGH) {
  delay(500);
}
if (digitalRead(7)==LOW){
 Keyboard.press(KEY_RIGHT_CTRL);
 Keyboard.press(KEY_RIGHT_SHIFT);
 Keyboard.press(91);
 delay(100);
 Keyboard.releaseAll();
 }

 while (digitalRead(9)==HIGH) {
  delay(500);
}
if (digitalRead(9)==LOW){
 Keyboard.press(KEY_RIGHT_CTRL);
 Keyboard.press(KEY_RIGHT_SHIFT);
 Keyboard.press(92);
 delay(100);
 Keyboard.releaseAll();
 }
}

The issue that I'm running into here is that each macro works, but only if I press them in the order that they are written in the code; ie, press the button on pin 3, then pin 5, then pin 7, etc. I need any of these macros to be executed in any order.

I would greatly appreciate it if someone could point out what I am missing here, or even tell me if I've done it all wrong, and suggest another function I could use instead.

Thanks,
DarkXoa

EDIT: Forgot to mention that I am using an Arduiuno Micro with AtMega32U4.

Delta_G:
I don't understand why you have these lines in here at all... There's no need to tie everything up in a while loop waiting for a button to be pressed.

Got rid of all of my while lines, and now it works like a charm!

I didn't realize they weren't necessary because every example I was looking at included a similar while statement before the if statement. I realize now that the examples I was looking at only executed one action.

Many thanks for your help, and also for the quick and courteous response!