Hello world
I'm in the middle of a project, where I build a mute button for a microphone on my windows PC. I'm using the program "MicMute" to set a shortcut that I send from my Arduino Trinket M0 when I press a physical button. My problem now is, that I use RDP remote desktop for work and my key commands from my Arduino end up on the remote desktop (only when I'm in the window of the remote desktop). My question is, can I somehow program my Arduino to send the key commands only to a specific application (MicMute)? Other solutions are also welcome.
SOLUTION: I installed the MicMute application on the PC I had remote acces too and did set it up exactly the same way I did on my home computer. This way it works as intended (just on the remote desktop).
The code I use (not original from me):
#include "Keyboard.h"
int buttonNum[5] = {3, 4, 2, 0, 1};
int buttSelect = 0;
int buttFlag = 0;
void setup() {
Serial.begin(115200);
for (int x = 0; x < 5; x++) {
pinMode(buttonNum[x], INPUT_PULLUP);
attachInterrupt(buttonNum[x], buttPressed, LOW);
}
Keyboard.begin();
}
void loop() {
while (buttFlag == 0) {
delay(10);
}
Serial.print("Button ");
Serial.print(buttSelect);
Serial.println(" pressed.");
switch (buttSelect) {
case 0:
Command0();
break;
case 1:
Command1();
break;
case 2:
Command2();
break;
case 3:
Command0();
break;
case 4:
Command1();
delay(1000);
Command2();
break;
default:
break;
}
int pressed = digitalRead(buttSelect);
while (pressed == 0) {
pressed = digitalRead(buttSelect);
}
buttFlag = 0;
}
void buttPressed() {
buttFlag = 1;
for (int x = 0; x < 5; x++) {
int butt = digitalRead(x);
if (butt == LOW) {
buttSelect = x;
break;
}
}
}
//Upload to Arduino
void Command0() {}
void Command1() {}
void Command2() {
Serial.println("Pressing CTRL+F12");
Keyboard.press(KEY_RIGHT_CTRL);
Keyboard.press(KEY_F12);
delay(100);
Keyboard.releaseAll();
delay(500);}
void Command3() {}
void Command4() {}