Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangul mode Numbers and some special keystrokes can not be input from the numeric pad. #2068

Closed
iyagicom opened this issue Dec 20, 2018 · 19 comments

Comments

@iyagicom
Copy link

iyagicom commented Dec 20, 2018

Please fill in the following items if you don't know the root cause.

Which distribution and version?: Ubuntu 18.04
(E.g. Fedora 27. Check /etc/fedora-release)

Which desktop environment and version?: ubuntu:GNOME , gnome-session (3.28.1-0ubuntu3) bionic; urgency=medium

(E.g. GNOME 3.24. Check $XDG_CURRENT_DESKTOP and your ISO image.)

Which session type?: X11 and Wayland
(X11 or Wayland. Check $XDG_SESSION_TYPE)

Which application and version?: Occurs in all programs.
(E.g. gedit 3.24, leafpad, kate, xterm)

IBus version?: IBus 1.5.17
(Run ibus version)

Issue description:

Hangul mode Numbers are not written on the numeric pad.
Also the backspace bar will not work.

I can not tell if this is due to ibus or any other problem.

vokoscreen-2018-06-22_20-16-08.zip

@fujiwarat
Copy link
Member

OK, I understand Backspace does not work with QT5 applications likes krita, kwrite.
But I think numpad works fine with ibus-hangul.
Probably I think you need to disable Hangul mode with Shift-space to enable numpad.
I think GTK applications work fine with ibus-hangul likes gedit, gnome-terminal.

@fujiwarat
Copy link
Member

OK, seems the numpad behavior is different between QT and GTK.
Also this problem does not happen with ibus-hangul 1.5.0 but 1.5.1.

@iyagicom
Copy link
Author

iyagicom commented Dec 27, 2018

I use SHIFT + SPAPEBAR to change Korean English.
There is no more typographical error than the Korean/English key.
Can not you solve this problem?

@fujiwarat
Copy link
Member

I investigated this issue furthermore and seems just your qt5 qtbase is old.

@fujiwarat
Copy link
Member

@iyagicom
Copy link
Author

iyagicom commented Mar 1, 2019

I am using UIM and Shift + Space translates "Hangul / English".
UIM does not have this bug.

@changwoo
Copy link

changwoo commented Mar 4, 2019

This issue needs to be re-opened.

FYI https://bugreports.qt.io/browse/QTBUG-58220

This issue is not because of the lack of forward-key-event handling, but because of the side effect of that the forward-key-event implementation.

Your patched code does not convert between ibus key codes and Qt key codes. Currently in Qt apps, UP/LEFT/DOWN/RIGHT arrow keys input "rqts". These are Japanese double width alphabets , which are ibus key codes interpreted as Qt key codes.

@fujiwarat
Copy link
Member

@changwoo Thank you.
Seems I tried to build the latest qtbase but didn't get the latest ibus-hangul by mistake.
@iyagicom Sorry not to get this bug.

@fujiwarat fujiwarat reopened this Mar 5, 2019
@changwoo
Copy link

changwoo commented Mar 9, 2019

For example in IBUS,

#define IBUS_KEY_Left 0xff51
#define IBUS_KEY_Up 0xff52
#define IBUS_KEY_Right 0xff53
#define IBUS_KEY_Down 0xff54

When these arrow key codes are used to make Qt key events without conversion, they become U+FF51 to U+FF54; "rqts".

@fujiwarat
Copy link
Member

@changwoo I understand your comment last week.
This is my patch to fix the issue; qtbase-xx-hangul-numpad.txt

If none find any concerns on the patch, I will submit it in QT side soon.

CC'ing @epico

@epico
Copy link
Member

epico commented Mar 12, 2019

I think some code is from src/plugins/platforms/xcb/qxcbkeyboard.cpp .

Is it possible to use QXcbKeyboard::keysymToQtKey method?

Or ask Qt maintainer to allow ibus to access the above method?

@fujiwarat
Copy link
Member

@epico Yes, I copied it and I don't think to use qxcbkeyboard.cpp at the moment.
Probably we may think to have a common header file through the patch review.

@epico
Copy link
Member

epico commented Mar 12, 2019

@fujiwarat Okay, I like to join the patch discussion.

Nice to share the common code with QXcbKeyboard! :)

@fujiwarat
Copy link
Member

@iyagicom If you could build qtbase, you could test my patch. Otherwise probably you need to wait for the new release since we make packages for Fedora only.

@choehwanjin
Copy link

+    if (keyval >= XK_KP_0 && keyval <= XK_KP_9) {
+        qtcode = keyval - XK_KP_0 + Qt::Key_0;
+    } else {
+        for (i = 0; KeyTbl[i]; i++) {
                                ^^^^^
                                      i += 2 will be better.
+            if (KeyTbl[i] == keyval) {
+                qtcode = KeyTbl[i + 1];
+                break;
+            }
+        }
+    }

I think binary search is better than linear search.

And it looks like it does not handle XK_F1 ~ XK_F35.

@fujiwarat
Copy link
Member

@choehwanjin Thank you for the review.
The latest patch is https://codereview.qt-project.org/#/c/255587

@choehwanjin
Copy link

The latest patch looks much better.

@fujiwarat
Copy link
Member

qtbase 5.13 will be fixed.

@iyagicom
Copy link
Author

Good job.
I am glad that the problem has been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants