diff options
author | Michele Calgaro <[email protected]> | 2021-03-15 10:50:14 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-03-15 11:20:18 +0900 |
commit | 37c26178be0e54dc42908b1cc5d7ec4802aff85b (patch) | |
tree | 2dedbcc64a1110bd2bc08fabb45a9d5e4ee5cfe3 /src/MainWidget.cpp | |
parent | 670268c0714ce4754cac757a4b13cc0fcdb71bd6 (diff) | |
download | kvkbd-37c26178be0e54dc42908b1cc5d7ec4802aff85b.tar.gz kvkbd-37c26178be0e54dc42908b1cc5d7ec4802aff85b.zip |
Fixed behavior of caps for non-alpha characters, which was broken in
commit 1865767.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 48c1053fa1e5896a10e576b9eb35634fa789cff4)
Diffstat (limited to 'src/MainWidget.cpp')
-rw-r--r-- | src/MainWidget.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/MainWidget.cpp b/src/MainWidget.cpp index 8797085..ff10c27 100644 --- a/src/MainWidget.cpp +++ b/src/MainWidget.cpp @@ -858,16 +858,17 @@ void MainWidget::updateNumlock() void MainWidget::toggleShift(unsigned int keycode) { send_key(keycode); - updateShift(); + updateShiftCaps(); } -void MainWidget::updateShift() +void MainWidget::updateShiftCaps() { - bool state = caps->isOn() ^ (lshift->isOn() || rshift->isOn()); + bool shiftState = lshift->isOn() || rshift->isOn(); + bool capsState = caps->isOn(); for (unsigned a = 0; a < btns.size(); a++) { VButton *v = btns[a]; - v->shiftPressed(state); + v->shiftCapsPressed(shiftState, capsState); } } @@ -880,7 +881,7 @@ void MainWidget::keyPress ( unsigned int a ) mod->setOn(false); } // Make sure the key labels are correctly updated - updateShift(); + updateShiftCaps(); } void MainWidget::send_key(unsigned int keycode) @@ -935,7 +936,7 @@ void MainWidget::queryModState() if (caps_state != caps->isOn()) { caps->setOn(caps_state); - updateShift(); + updateShiftCaps(); } bool numl_state = keyState(XK_Num_Lock); |