Use IRremote to control DC motor

Hi All
I’m new to using Arduino, I am trying to use a Keyes IR remote ( same as what was used in this site to control a DC motor

I have tried to use IF and SWITCH statement, but the motor only responds to the first IF or CASE statement which is to move forward, and doesn’t accept any other command from the IRremote, and just continues to move forward
I want to be able to press a key and it will change to the command assigned to the key

For the one_motor.ino file, how can I make LxAlarm high when the brake is HIGH, that is both execute simultaneously

Thank you all for your support

one_motor_IR.ino (1.61 KB)

one_motor_IR_trial_switch_eddie.ino (1.53 KB)

one_motor.ino (1.82 KB)