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>
pull/10/head
Michele Calgaro 3 years ago
parent 26c5e3891f
commit af106fa553
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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 )

@ -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);

@ -212,7 +212,6 @@ int main(int argc, char **argv)
}
else
{
TDECmdLineArgs::init(argc, argv, &about);
TDECmdLineArgs::addCmdLineOptions( options );
Kvkbd::addCmdLineOptions();

Loading…
Cancel
Save