Qt

Numeric keypad not working in kcalc

Bug #1503170 reported by Marius B. Kotsbak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE Utilities
Won't Fix
Medium
Qt
Fix Committed
Undecided
Unassigned
kcalc (Ubuntu)
Invalid
Undecided
Unassigned
qtbase-opensource-src (Ubuntu)
Fix Released
Undecided
Timo Jyrinki

Bug Description

The numbers in the numeric keypad is not working anymore in this version. The other number keys are working fine.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: kcalc 4:15.08.1-0ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-14.16-generic 4.2.2
Uname: Linux 4.2.0-14-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19-0ubuntu1
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Oct 6 10:01:48 2015
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-precise-amd64-20130203-1
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-03-12 (572 days ago)
InstallationMedia: Ubuntu 12.04 "Precise" - Build amd64 LIVE Binary 20130203-13:50
SourcePackage: kcalc
UpgradeStatus: No upgrade log present (probably fresh install)

Upstream Qt bug report: https://bugreports.qt.io/browse/QTBUG-33093

Revision history for this message
In , Harald-pollak (harald-pollak) wrote :

Input from standard keys ( keysym as written by xev: 0x31, 1 ) works fine, the number 1 is displayed in the display, but when i press the number 1 on my numerickey pad ( xev: 0ffb1, KP_1 ) nothing happens in the display.

Reproducible: Always

Steps to Reproduce:
after kcalc started
1. press 1 from standard keyboard
2. press 1 from numeric keypad

Actual Results:
1. 1 is displayed correctly
2. nothing happens

Expected Results:
1. 1 is displayed
2. 11 is displayed

It tried to make a quick and dirty test in the code ( inside void KCalculator::keyPressEvent(QKeyEvent *e) ):

I added:

std::cout << "Key pressed: " << e->key() << std::endl;

if (e->key() == Qt::Key_1) {
            pb1->animateClick();
}

If I press std-key 1 no output on console ( it seems shortcut action as used is cauth before key-pressed event sent ).

After press key 1 from nummeric-keypad: pb1->enimateClick() is called ( no it's allso displayed correctly ) and on console: "Key pressed: 49" displayed.

Maybe its better to work with key-events than shortcuts ( so far i've seen only one shortcut is possible for each Button )

Revision history for this message
In , Harald-pollak (harald-pollak) wrote :

I thinkthis is a Problem with the QT-Shortcuts: this work-arround works vor me:

in kcalc.cpp at the end of "void KCalculator::keyPressEvent(QKeyEvent *e)":

        switch (e->key()) {
        case Qt::Key_0:
            // 0 is available in all number systems, so the Button will never be deactivated
            pb0->animateClick();
            break;
        case Qt::Key_1:
            // 1 is available in all number systems, so the Button will never be deactivated
            pb1->animateClick();
            break;
        case Qt::Key_2:
            if(pb2->isEnabled())
                pb2->animateClick();
            break;
        case Qt::Key_3:
            if(pb3->isEnabled())
                pb3->animateClick();
            break;
        case Qt::Key_4:
            if(pb4->isEnabled())
                pb4->animateClick();
            break;
        case Qt::Key_5:
            if(pb5->isEnabled())
                pb5->animateClick();
            break;
        case Qt::Key_6:
            if(pb6->isEnabled())
                pb6->animateClick();
            break;
        case Qt::Key_7:
            if(pb7->isEnabled())
                pb7->animateClick();
            break;
        case Qt::Key_8:
            if(pb8->isEnabled())
                pb8->animateClick();
            break;
        case Qt::Key_9:
            if(pb9->isEnabled())
                pb9->animateClick();
            break;
        case Qt::Key_Enter:
            if(pbEqual->isEnabled())
                pbEqual->animateClick();
            break;
        case Qt::Key_Equal:
            if(pbEqual->isEnabled())
                pbEqual->animateClick();
            break;
        case Qt::Key_Plus:
            if(pbPlus->isEnabled())
                pbPlus->animateClick();
            break;
        case Qt::Key_Minus:
            if(pbMinus->isEnabled())
                pbMinus->animateClick();
            break;
        case Qt::Key_Comma:
            if(pbPeriod->isEnabled())
                pbPeriod->animateClick();
            break;
        case Qt::Key_Asterisk:
            if(pbMultiplication->isEnabled())
                pbMultiplication->animateClick();
            break;
        case Qt::Key_Slash:
            if(pbDivision->isEnabled())
                pbDivision->animateClick();
            break;
        default:
            break;
        }

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 340846 has been marked as a duplicate of this bug. ***

Revision history for this message
In , fademind (fademind) wrote :

*** This bug has been confirmed by popular vote. ***

Revision history for this message
In , fademind (fademind) wrote :

Distro: Arch Linux x64
Package details:
kcalc 15.04.0-1
plasma-desktop 5.2.2-3
plasma-framework 5.9.0-1
plasma-workspace 5.2.2-2

Revision history for this message
In , Luis Lezcano Airaldi (devilishfreak) wrote :

I'm also facing this issue. The problem is that KConfig (the library that manages keyboard shortcuts) is not reading Qt::Keypad_Modifier which is set when pressing keypad keys.

https://bugs.kde.org/show_bug.cgi?id=346806

Revision history for this message
In , Vojtěch Erben (erbengi) wrote :

Same issue on Kubuntu 15.04 with KDE 5.3 (via kubuntu/backports ppa)

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 347325 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Cfeck (cfeck) wrote :

This is a regression in Qt5.

See patch and link to bug at https://codereview.qt-project.org/#/c/95219/

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 347459 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Rdieter-math (rdieter-math) wrote :

I can confirm the qt patch referenced in comment #8 seems to work as advertised.

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 347609 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 347648 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 347713 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Cfeck (cfeck) wrote :

*** Bug 348695 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Proteus5 (proteus5) wrote :

So what's the solution of this bug?

Revision history for this message
In , Rdieter-math (rdieter-math) wrote :

See comment #8

Revision history for this message
In , Proteus5 (proteus5) wrote :

(In reply to Rex Dieter from comment #16)
> See comment #8

the explanation is a bit superficial, developer has to explain every single step to the common user.

Revision history for this message
In , Rdieter-math (rdieter-math) wrote :

In short, it's a Qt5 bug/issue, and the link in comment #8 is a proposed fix (but not included in Qt5 sources yet, as of this moment)

Revision history for this message
In , Proteus5 (proteus5) wrote :

(In reply to Rex Dieter from comment #18)
> In short, it's a Qt5 bug/issue, and the link in comment #8 is a proposed fix
> (but not included in Qt5 sources yet, as of this moment)

Ok thanks I'll wait for an update of kcalc itself which the bug will be fixed.

Revision history for this message
In , Rdieter-math (rdieter-math) wrote :

It's not a kcalc bug, so no kcalc update will fix this, but rather, hopefully some future version of Qt5 will include a fix.

Feel free to bug/nag your distro into considering including the candidate Qt5 fix (fedora does, for example)

Revision history for this message
In , Proteus5 (proteus5) wrote :

(In reply to Rex Dieter from comment #20)
> It's not a kcalc bug, so no kcalc update will fix this, but rather,
> hopefully some future version of Qt5 will include a fix.
>
> Feel free to bug/nag your distro into considering including the candidate
> Qt5 fix (fedora does, for example)

Ok thanks... by the way is chromium played by qtwebengine planned to be realized in the near future or some other KDE browser?

note: which=when in the previous comment.

Revision history for this message
In , Proteus5 (proteus5) wrote :

EDIT: NEWS... I've installed again KUBUNTU 15.04 Before installing it I've tested and kcalculator works by numlock activated it on the keyboard. NOw or the problems concern with keyboard controller I changed it enabling numlock boot activation, or problem concerns with PLASMA upgrade I made before using kcalculator.

Revision history for this message
In , Heart (h-trader) wrote :

I'm also suffering this bug now and I don't have Qt5 (it worked on openSUSE 13.2 all the time. Must be something with latest KDE updates...).

~ kde4-config --version
Qt: 4.8.6
KDE: 4.14.9
kde4-config: 1.0

I had kcalc v15.04.3-1.2 installed (from KDE:Applications repo)

i | kcalc | Paket | 15.04.3-1.2 | x86_64 | KDE:Applications

So I tried downgrading kcalc package to latest version from openSUSE 13.2 OSS Update repo

zypper install --oldpackage kcalc-14.12.3-16.1.x86_64

and with that version the numkeys are working again!

Revision history for this message
In , Cfeck (cfeck) wrote :

Hermann, kcalc since version 15.04 uses Qt5, regardless of your Plasma desktop version.

Revision history for this message
In , Pelardonable (pelardonable) wrote :

Please fix num-pad input.

Revision history for this message
In , Cfeck (cfeck) wrote :

It is fixed in Qt (at least in the 5.6 branch, not sure if it was backported to Qt 5.5.x).

Revision history for this message
Marius B. Kotsbak (mariusko) wrote :
description: updated
summary: - Numeric keypad not working
+ Numeric keypad not working in kcalc
Changed in kdeutils:
importance: Unknown → Medium
status: Unknown → Won't Fix
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

It'd be useful to find out the commit that's claimed to be in Qt 5.6 that fixes the issue. I can then see about backporting it to Qt 5.5 (https://wiki.ubuntu.com/Touch/QtTesting) and 5.4 if it's not hugely invasive.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Oh right, even though the linked commit was from 2014 it's probably still the one: https://codereview.qt-project.org/#/c/95219/

It'll be in 5.5.1, and is small indeed.

Changed in qtbase-opensource-src (Ubuntu):
assignee: nobody → Timo Jyrinki (timo-jyrinki)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :
Changed in qtbase-opensource-src (Ubuntu):
status: New → Fix Committed
Changed in qt:
status: New → Fix Committed
Changed in kcalc (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.4.2+dfsg-2ubuntu8

---------------
qtbase-opensource-src (5.4.2+dfsg-2ubuntu8) wily; urgency=medium

  * debian/patches/Fix-shortcuts-with-keypad-keys.patch
    - Fix numeric keypad keys (LP: #1503170)
  * debian/libqt5gui5.symbols:
    - Update two related private symbols.

 -- Timo Jyrinki <email address hidden> Wed, 07 Oct 2015 13:28:33 +0000

Changed in qtbase-opensource-src (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.