@ecstaticbrick Arduino isn't that difficult to code. I build a button box for flight sim with it. It's some typing effort, but the logic behind it, is pretty straight forward.
Code:
#include <Keyboard.h>#define MasterArmTrain 0 //LCtrl+LAlt+'m'
#define MasterArmOFF 0 //LCtrl+LShift+'m'
#define MasterArmON 1 //LShift+LAlt+'m'
#define TGPOFF 2 //LCtrl+LShift+'t'
#define TGPON 2 //LCtrl+LShift+'t'
#define LaserTrain 3 //LCtrl+LShift+'l'
#define LaserOFF 3 //LCtrl+LAlt+'l'
#define LaserON 4 //LAlt+LShift+'l'
#define AP 5 //'a'
#define AP_PATH 6 //'2'
#define AP_ALT_BANK 7 //'4'
#define AP_ALT_HDG 8 //'3'
#define GearDown 9 //LShift+'g'
#define GearUp 9 //LCtrl+'g'
#define FlapsDown_1 10 //'f'
#define FlapsDown_2 11 //'f'
#define FlapsUp_1 11 //LShift+'f'
#define FlapsUp_2 10 //LShift+'f'
#define CanopyOpen A0 //'c'
#define CanopyClose A1 //'c'
int switchStateMasterArm = 0;
int switchStateTGP = 0;
int switchStateLaser = 0;
int switchStateGear = 0;
int switchStateFlaps = 0;
// int switchStateCanopy = 0;
void setup() {
// put your setup code here, to run once:
delay(5000);
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
//MasterArmTrain
if ((digitalRead(MasterArmTrain) == LOW) && (switchStateMasterArm != 1)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(130); //LAlt
Keyboard.press('m');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateMasterArm = 1;
}
//MasterArmOFF
if ((digitalRead(MasterArmOFF) == HIGH) && (switchStateMasterArm != 0)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(129); //LShift
Keyboard.press('m');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateMasterArm = 0;
}
//MasterArmON
if ((digitalRead(MasterArmON) == LOW) && (switchStateMasterArm != 2)) {
Keyboard.begin();
Keyboard.press(129); //LShift
Keyboard.press(130); //LAlt
Keyboard.press('m');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateMasterArm = 2;
}
//TGPOFF
if ((digitalRead(TGPOFF) == HIGH) && (switchStateTGP != 0)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(129); //LShift
Keyboard.press('t');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateTGP = 0;
}
//TGPON
if ((digitalRead(TGPON) == LOW) && (switchStateTGP != 2)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(129); //LShift
Keyboard.press('t');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateTGP = 2;
}
//LaserTrain
if ((digitalRead(LaserTrain) == LOW) && (switchStateLaser != 1)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(129); //LShift
Keyboard.press('l');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateLaser = 1;
}
//LaserOFF
if ((digitalRead(LaserOFF) == HIGH) && (switchStateLaser != 0)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press(130); //LAlt
Keyboard.press('l');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateLaser = 0;
}
//LaserON
if ((digitalRead(LaserON) == LOW) && (switchStateLaser !=2)) {
Keyboard.begin();
Keyboard.press(129); //LShift
Keyboard.press(130); //LAlt
Keyboard.press('l');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateLaser = 2;
}
//AP ON/OFF
if (digitalRead(AP) == LOW) {
Keyboard.begin();
Keyboard.write('a');
delay(100);
Keyboard.end();
}
//AP_PATH
if (digitalRead(AP_PATH) == LOW) {
Keyboard.begin();
Keyboard.write('2');
delay(100);
Keyboard.end();
}
//AP_ALT_BANK
if (digitalRead(AP_ALT_BANK) == LOW) {
Keyboard.begin();
Keyboard.write('4');
delay(100);
Keyboard.end();
}
//AP_ALT_HDG
if (digitalRead(AP_ALT_HDG) == LOW) {
Keyboard.begin();
Keyboard.write('3');
delay(100);
Keyboard.end();
}
//GearDown
if ((digitalRead(GearDown) == HIGH) && (switchStateGear != 0)) {
Keyboard.begin();
Keyboard.press(129); //LShift
Keyboard.press('g');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateGear = 0;
}
//GearUp
if ((digitalRead(GearUp) == LOW) && (switchStateGear != 1)) {
Keyboard.begin();
Keyboard.press(128); //LCtrl
Keyboard.press('g');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateGear = 1;
}
//Flaps
if ((digitalRead(10) == HIGH) && (digitalRead(11) == HIGH) && (switchStateFlaps == 0)){
Keyboard.begin();
Keyboard.releaseAll();
Keyboard.end();}
else{
//FlapsDown_1
if ((digitalRead(FlapsDown_1) == HIGH) && (digitalRead(FlapsDown_2) == HIGH) && (switchStateFlaps != 1)) {
Keyboard.begin();
Keyboard.write('f');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateFlaps = 1;
}
//FlapsDown_2
if ((digitalRead(FlapsDown_1) == HIGH) && (digitalRead(FlapsDown_2) == LOW) && (switchStateFlaps != 2)) {
Keyboard.begin();
Keyboard.write('f');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateFlaps = 2;
}
//FlapsUp_1
if ((digitalRead(FlapsUp_1) == HIGH) && (digitalRead(FlapsUp_2) == HIGH) && (switchStateFlaps != 3)) {
Keyboard.begin();
Keyboard.press(129); //LShift
Keyboard.press('f');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateFlaps = 3;
}
//FlapsUp_2
if ((digitalRead(FlapsUp_2) == LOW) && (digitalRead(FlapsUp_1 == HIGH)) && (switchStateFlaps != 4)) {
Keyboard.begin();
Keyboard.press(129); //LShift
Keyboard.press('f');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
switchStateFlaps = 4;
}
}
//CanopyClose
if (digitalRead(CanopyClose) == LOW) {
Keyboard.begin();
Keyboard.write('c');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
}
//CanopyOpen
if (digitalRead(CanopyOpen) == LOW) {
Keyboard.begin();
Keyboard.write('c');
delay(100);
Keyboard.releaseAll();
Keyboard.end();
}
}