Bug 283521 - cannot enter hex letters with shift key pressed
Summary: cannot enter hex letters with shift key pressed
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 09:13 UTC by thnielsen
Modified: 2019-07-10 19:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.08.0


Attachments
Proposed patch (1.11 KB, patch)
2017-05-15 20:51 UTC, martonmiklos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thnielsen 2011-10-07 09:13:14 UTC
Version:           unspecified (using KDE 4.7.1) 
OS:                Linux

You may wonder why I want to enter the hex letters a-f in upper case, but on French keyboard the numbers are entered holding the shift key, and to not enter digits WITH the shift key, and letters WITHOUT (cramps the little finger), it is tempting to just hold the shift key all the time - however when doing so, letters are not accepted.
Just for the fun, I should mention, that when entering lower case letters - they are displayed as upper case (which I find correct) but even so more fun, when you consider, that you cannot enter upper case letters :-)


Reproducible: Always

Steps to Reproduce:
start kcalc, click hex radio button, start to enter number, letters, try entering letters a-f with shift key - they will not appear.

Actual Results:  
letters a-f entered on keyboard with shift key pressed do not appear

Expected Results:  
letters a-f entered on keyboard with shift key should appear with and without shift key
Comment 1 Michael Skiba 2012-07-03 21:27:12 UTC
The problem is that some keys, like  E and D, are already mapped. E maps to x*10^ y and D to Dat. It is possible to change them in the source if noone objects ...
Comment 2 martonmiklos 2017-05-15 20:19:03 UTC
Any news on this one?

I have checked the KCalc 15.12.3 and the issue is still present. 
Regarding to the mapped keys:
The x*10^y function is unavailable in HEX mode, and the Dat function is only available in Statistical mode, so I do not think that it should be a big objection.
Comment 3 martonmiklos 2017-05-15 20:51:43 UTC
Created attachment 105570 [details]
Proposed patch
Comment 4 martonmiklos 2017-05-15 20:53:49 UTC
Adding multiple shortcuts to the same button in the ui file (like A, Shift+A) does not works on Qt 5.8.0. So I propose to handle these events in the keyPressEvent method. Patch attached.
Comment 5 Julian Steinmann 2019-02-12 18:55:19 UTC
I have not reviewed the patch, but the change seems sensible to me. Please submit your patch to Phabricator if you are still around @martonmiklos.
Comment 6 martonmiklos 2019-02-12 19:00:02 UTC
(In reply to Julian Schraner from comment #5)
> I have not reviewed the patch, but the change seems sensible to me. Please
> submit your patch to Phabricator if you are still around @martonmiklos.

Hi Julian,
Thanks for checking it out I will submit it via phabricator.
Comment 7 martonmiklos 2019-02-12 21:10:28 UTC
Submitted to phabricator D18967.
Comment 8 Christoph Feck 2019-07-10 19:01:45 UTC
Git commit 5763ce932d66d5101c0e5bf0b6f11279716b2710 by Christoph Feck, on behalf of Miklos Marton.
Committed on 10/07/2019 at 18:58.
Pushed by cfeck into branch 'master'.

Accept hex letters with the Shift key pressed

When kcalc is switched to hexadecimal mode, the A-F characters
cannot be entered when the Shift key is pressed.

This patch enables this.
FIXED-IN: 19.08.0

Differential Revision: https://phabricator.kde.org/D18967

M  +28   -0    kcalc.cpp

https://commits.kde.org/kcalc/5763ce932d66d5101c0e5bf0b6f11279716b2710