I’m fairly new . . .
I used the SparkFun sample Keyboard HID code for Pro Micro 5v - it works on my local computer.
But when that computer is connected to another via Remote Desktop - then characters typed are often of the incorrect case. Specifically it seems capitals randomly get changed to their lower case versions.
I only seemed to happen if the characters were capitalized - it would show them remotely as Lower Case - sometimes.
Any characters that were lower case always remained lower case.
For example :
Only4Royce14! [ correct ]
May show as :
only4Royce14!
only4royce141
Only4royce14!
Any combination of the O, R or ! randomly being toggled to its lower case version.
I ideas ? [ I added a bunch of delays to try to fix, but no joy. ]
Here’s the code :
/* HID KeyBoard Example
by: Jim Lindblom
date: 1/12/2012
license: MIT License - Feel free to use this code for any purpose.
No restrictions. Just keep this license if you go on to use this
code in your future endeavors! Reuse and share.
This is very simplistic code that allows you to send a ‘z’ with
a momentary pushbutton.
*/
#include <Keyboard.h>
int buttonPin = 9; // Set a button to any pin
void setup()
{
pinMode(buttonPin, INPUT); // Set the button as an input
digitalWrite(buttonPin, HIGH); // Pull the button high
}
void loop()
{
if (digitalRead(buttonPin) == 0) // if the button goes low
{
delay(150);
Keyboard.write(79); // send an ‘O’ to the computer via Keyboard HID
// Here I’m even trying ASCII, but with the same random lower case results.
delay(150);
Keyboard.write(‘n’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘l’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘y’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘4’); // send a ‘z’ to the computer via Keyboard HID
delay(150);
Keyboard.write(82); // send an ‘R’ to the computer via Keyboard HID
delay(150);
Keyboard.write(‘o’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘y’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘c’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘e’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘1’); // send a ‘z’ to the computer via Keyboard HID
delay(50);
Keyboard.write(‘4’); // send a ‘z’ to the computer via Keyboard HID
delay(150);
Keyboard.write(33); // send a ‘!’ to the computer via Keyboard HID
delay(150);
delay(1000); // delay so there aren’t a kajillion z’s
}
}
When I manually type to the remote computer - there are never case problems.
Thank you