Keyboard modifier (Not hold the CTRL and the SHIFT)

Status
Not open for further replies.
I will send a "CTRL + SHIFT 15" from the Teensy 3.6 with the normal USB connection, it wil not be press and hold the "CTRL + SHIFT".
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
The Code:
Keyboard.set_modifier(MODIFIERKEY_CTRL | MODIFIERKEY_SHIFT);
Keyboard.set_key1(KEY_1);
Keyboard.set_key2(KEY_5);
Keyboard.send_now();
delay(20);
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.set_key2(0);
Keyboard.send_now();

When i send this from a normal keyboard, i see this:
---------------------------------------------------------------------
SHIFT CTRL 49 1
SHIFT CTRL 53 5
CTRL 16 
17 

When i send this from the Teensy, i see this:
------------------------------------------------------------
SHIFT 17 
16 
49 1
53 5


What are wrong?

Thanks.
 
Last edited:
This will work:

Keyboard.press(MODIFIERKEY_CTRL);
delay(2);
Keyboard.press(MODIFIERKEY_SHIFT);
delay(2);
Keyboard.press(KEY_1);
delay(2);
Keyboard.release(KEY_1);
delay(2);
Keyboard.press(KEY_6);
delay(2);
Keyboard.release(KEY_6);
delay(2);
Keyboard.release(MODIFIERKEY_SHIFT);
delay(2);
Keyboard.release(MODIFIERKEY_CTRL);
 
Status
Not open for further replies.
Back
Top