Moved key press to correct place

Moved the if statement to where the key variable actually exists.
Theme Toggle (Flat/Default)

Use ; to toggle Default & ‘ to toggle Flat theme.