I'm working on a custom remote keyboard/trackball handled by Nano V3 and MCP27013 with fiber link to a remote R4 minima which takes in serial data packets and spits out HID keyboard and trackball. I've got it all working nicely except I can't get the shift key working for letters. Caps Lock works for letters, but not shift. Shift does work for numbers, one letter only then it reverts.
Here is a small demo program to illustrate the issue with shift for the letter A.
I'm hoping someone can help. I'm SO close to success and this is a show stopper. The full demo code is shown, You can safely run it on a Minima but move your cursor to the comments section on top before it starts.
/*Keyboard library test on Uno R4 Minima
This test shows that the caps lock key affects letter keys, but the shift key
does not have any effect on A-Z. It does affect for one key press only the numerics
and other printable letters. But NOT LETTERS. I have tried Keyboard.write instead of
press and release, it is also unaffected by the shift key.
The following line is the actual Uno R4 MInima USB HID output from this test program:
AAaa
If the shift key worked it should look like:
AaaA
*/
#include "Keyboard.h";
#include "Serial.h";
void setup() {
Keyboard.begin();
delay(1000); //I've had problems without this.
}
void loop() {
delay(5000);//QUICK-MOVE THE CURSOR TO THE COMMENT SECTION!
Keyboard.press(65); //letter A
Keyboard.releaseAll();
Keyboard.press(KEY_LEFT_SHIFT);//then shift
Keyboard.press(65); //shifted A
Keyboard.releaseAll();// release all
// next the same with with caps lock toggled
Keyboard.press(KEY_CAPS_LOCK);
Keyboard.release(KEY_CAPS_LOCK);
Keyboard.press(65); //letter A
Keyboard.releaseAll();
Keyboard.press(KEY_LEFT_SHIFT);//then shift
Keyboard.press(65); //shifted A
Keyboard.releaseAll();// release all
while (1) { delay(1000);// Hang forever so we keep spitting out letters
}
}