I bought a Teensy 3.2 as I couldn't get my Arduino Micro to work with the BootKeyboard library.
The Teensy works fine as a keyboard in boot mode, however I can't get the mouse to work. Is there something I need to do to get the mouse functioning in boot mode? When I plug it into a computer running Windows 7 the code works fine and as expected. When I connect it via the KVM (The reason I need it in boot mode) it doesn't function. The sketch is designed to operate the KVM (Screen toggle and click a button with emulated mouse) from a 4 button remote and since switching to Teensy the screen toggle (Double tap CTRL) works (The keypress is registering as the LED does flash).
The Teensy works fine as a keyboard in boot mode, however I can't get the mouse to work. Is there something I need to do to get the mouse functioning in boot mode? When I plug it into a computer running Windows 7 the code works fine and as expected. When I connect it via the KVM (The reason I need it in boot mode) it doesn't function. The sketch is designed to operate the KVM (Screen toggle and click a button with emulated mouse) from a 4 button remote and since switching to Teensy the screen toggle (Double tap CTRL) works (The keypress is registering as the LED does flash).
Code:
const int KeypadA = 4;
const int KeypadB = 3;
const int KeypadC = 2;
const int KeypadD = 1;
int Keypress = 0;
int KeyA = 0;
int KeyB = 0;
int KeyC = 0;
int KeyD = 0;
void setup() {
Mouse.screenSize(1920, 1080);
pinMode(KeypadA, INPUT);
pinMode(KeypadB, INPUT);
pinMode(KeypadC, INPUT);
pinMode(KeypadD, INPUT);
pinMode(13, OUTPUT);
for(int x = 0; x < 125; x++){
digitalWrite(13, HIGH);
delay(20);
digitalWrite(13, LOW);
delay(20);
}
}
void loop() {
delay(2);
Keypress = digitalRead(KeypadA);
if (Keypress == HIGH) {
KeyA = KeyA + 1;
KeyB = 0;
KeyC = 0;
KeyD = 0;
}
Keypress = digitalRead(KeypadB);
if (Keypress == HIGH) {
KeyA = 0;
KeyB = KeyB + 1;
KeyC = 0;
KeyD = 0;
}
Keypress = digitalRead(KeypadC);
if (Keypress == HIGH) {
KeyA = 0;
KeyB = 0;
KeyC = KeyC + 1;
KeyD = 0;
}
Keypress = digitalRead(KeypadD);
if (Keypress == HIGH) {
KeyA = 0;
KeyB = 0;
KeyC = 0;
KeyD = KeyD + 1;
}
if (KeyA == 3) {
digitalWrite(13, HIGH);
Keyboard.press(MODIFIERKEY_CTRL);
delay(20);
digitalWrite(13, LOW);
Keyboard.release(MODIFIERKEY_CTRL);
delay(100);
digitalWrite(13, HIGH);
Keyboard.press(MODIFIERKEY_CTRL);
delay(20);
digitalWrite(13, LOW);
Keyboard.release(MODIFIERKEY_CTRL);
delay(860);
KeyA = 0;
KeyB = 0;
KeyC = 0;
KeyD = 0;
}
if (KeyB == 3) {
digitalWrite(13, HIGH);
Mouse.moveTo(1650,1036);
delay(50);
digitalWrite(13, LOW);
Mouse.click();
delay(950);
KeyA = 0;
KeyB = 0;
KeyC = 0;
KeyD = 0;
}
}
Last edited: