diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-03-16 11:57:25 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-03-16 12:10:12 +0900 |
| commit | 221d437a4bb3edd596df61eeb23fce3a63331091 (patch) | |
| tree | c84fe88547f40bbdb9c8dea8bcd7255ad793a0a0 /src/MainWidget.cpp | |
| parent | 1585c4cc1813e12f60085c29dd9d8a3c98c8fe98 (diff) | |
| download | kvkbd-221d437a4bb3edd596df61eeb23fce3a63331091.tar.gz kvkbd-221d437a4bb3edd596df61eeb23fce3a63331091.zip | |
Fixed visualization of key text the first time modifier keys are
pressed.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
This commit also include a small part of Ray's patch to fix
visualization of & if it is on a lower character position.
Signed-off-by: Ray-V <ray-v@inbox.lv>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit af106fa553fb2f706910686a0e30f909582bca7d)
Diffstat (limited to 'src/MainWidget.cpp')
| -rw-r--r-- | src/MainWidget.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/MainWidget.cpp b/src/MainWidget.cpp index ff10c27..ea6fc9b 100644 --- a/src/MainWidget.cpp +++ b/src/MainWidget.cpp @@ -953,12 +953,19 @@ void MainWidget::setupText(VButton& v) // lowercase text KeySym keysym_l = XkbKeycodeToKeysym(display, keycode, 0, 0); - TQString btn_text(TQChar((uint)keysym2ucs(keysym_l))); - v.setText(btn_text); + TQChar c((uint)keysym2ucs(keysym_l)); + if (c == '&') + { + v.setText("&&"); + } + else + { + v.setText(c); + } // uppercase text KeySym keysym_u = XkbKeycodeToKeysym(display, keycode, 0, 1); - TQChar c((uint)keysym2ucs(keysym_u)); + c = (uint)keysym2ucs(keysym_u); if (c == '&') { v.setShiftText("&&"); @@ -976,6 +983,8 @@ void MainWidget::mappingNotify(XMappingEvent *) VButton *v = btns[a]; setupText(*v); } + updateNumlock(); + updateShiftCaps(); } KbdDock::KbdDock ( MainWidget *m ) |
