Skip to content

Commit

Permalink
fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-commits committed Jan 31, 2021
1 parent 7ca923b commit dfa403b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/keyboard/NeoReportParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ void NeoReportParser::OnKeyUp(uint8_t mod, uint8_t key) {
Consumer.releaseAll();
}

if(!(activeSequence.key == 0 && activeSequence.modifier == 0)){ //release active holds from substitution
//release keys from active sequence if active sequence ended
if(!(activeSequence.key == 0 && activeSequence.modifier == 0) && key != KEY_LEFT_CTRL && key != KEY_RIGHT_CTRL) {
Keyboard.release(KeyboardKeycode(activeSequence.key));

if (kbdLockingKeys.kbdLeds.bmCapsLock && activeSequence.key < KEY_SLASH && activeSequence.key != KEY_TILDE) {
Expand Down Expand Up @@ -673,6 +674,14 @@ void NeoReportParser::substitutePress(const InputSequence &sq){

Keyboard.releaseAll();

//restore control keys (used for word-wise marking in L4)
if (neoModifiers.bmLeftCtrl) {
Keyboard.press(KeyboardKeycode(KEY_LEFT_CTRL));
}
if (neoModifiers.bmRightCtrl){
Keyboard.press(KeyboardKeycode(KEY_RIGHT_CTRL));
}

if (kbdLockingKeys.kbdLeds.bmCapsLock && sq.key < KEY_SLASH && sq.key != KEY_TILDE) {
if(sq.modifier == KEY_RESERVED) {
Keyboard.press(KeyboardKeycode(KEY_LEFT_SHIFT));
Expand Down

0 comments on commit dfa403b

Please sign in to comment.