I am using an Arduino Leonardo to have hotkeys for OBS but they don't work when the OBS Studio window is not focused.
I have the Leonardo press Ctrl + Alt + Shift + F7 when I press a button connected to the Leonardo. On OBS I have Ctrl + Alt + Shift + F7 switch to a slide. When I have the OBS window focused and I press the button it works fine. But when I have another application focused it does not work. The strange thing is, is that when I press (on my keyboard) Ctrl + Alt + Shift + F7, it will switch to the slide, but when I press the button it does not work.
I am running OBS as an Administrator btw.
My code for the Leonardo is below
int pinA = 8;
void setup() {
pinMode(pinA, INPUT);
}
void loop(){
digitalWrite(pinA, HIGH);
readPinA = digitalRead(pinA);
if (readPinA == 0){
Serial.print("A\n");
Keyboard.press(KEY_RIGHT_CTRL);
Keyboard.press(KEY_RIGHT_ALT);
Keyboard.press(KEY_RIGHT_SHIFT);
Keyboard.press(KEY_F7);
Keyboard.releaseAll();
delay(250);
}
}