diff options
author | Michele Calgaro <[email protected]> | 2021-03-16 11:57:25 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-03-16 11:57:25 +0900 |
commit | af106fa553fb2f706910686a0e30f909582bca7d (patch) | |
tree | 7627b54658ca1c8a6cd44ef7b3bfdad3440b6cf6 | |
parent | 26c5e3891f5e9e6343e587731a93f4438539179e (diff) | |
download | kvkbd-af106fa553fb2f706910686a0e30f909582bca7d.tar.gz kvkbd-af106fa553fb2f706910686a0e30f909582bca7d.zip |
Fixed visualization of key text the first time modifier keys are
pressed.
Signed-off-by: Michele Calgaro <[email protected]>
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 <[email protected]>
Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r-- | src/MainWidget.cpp | 15 | ||||
-rw-r--r-- | src/VButton.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 1 |
3 files changed, 14 insertions, 4 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 ) diff --git a/src/VButton.cpp b/src/VButton.cpp index c949612..e44feba 100644 --- a/src/VButton.cpp +++ b/src/VButton.cpp @@ -51,6 +51,8 @@ void VButton::shiftCapsPressed(bool shift, bool caps) void VButton::setText(const TQString& text) { + // Need to set the pushbutton text to correctly handle those buttons which usually + // don't change (tab, shift, caps, Fn, ...) TQPushButton::setText(text); lowerText = text; isAlpha = text.length() == 1 && (text.upper() != text); diff --git a/src/main.cpp b/src/main.cpp index d080452..b818489 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -212,7 +212,6 @@ int main(int argc, char **argv) } else { - TDECmdLineArgs::init(argc, argv, &about); TDECmdLineArgs::addCmdLineOptions( options ); Kvkbd::addCmdLineOptions(); |