Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.2
-
None
-
-
9ef69efb3bde086b593787efdda5ebd8f3544768 (qt/qtbase/dev) 2593479928ee2c348d2e830d93a5ee82d9b1d1e5 (qt/qtbase/6.2) 25fbb2173689838b4f62a2f2130bb4a8f1c0029e (qt/tqtc-qtbase/5.15)
Description
Consider a simple program which logs all keyPressEvent it receives:
#include<iostream> #include<QApplication> #include<QWidget> #include<QKeyEvent> struct App:QWidget{ void keyPressEvent(QKeyEvent* event){ std::cout<<"key 0x"<<std::hex<<event->key()<<", text "; char prev='['; for(QChar& c:event->text()){ std::cout<<prev<<"0x"<<c.unicode(); prev=' '; } if(prev=='[')std::cout<<'['; std::cout<<"]\n"; } }; int main(int argc,char** argv){ QApplication app(argc,argv); App ex; ex.show(); return app.exec(); }
When this command is executed
xdotool type --window 87654321 --clearmodifiers $(printf '\U0001f3fc')
(with --window value set appropriately) the logged information is
key 0xd83c, text [0xd83c 0xdffc]
The expected value of key should be 0x1f3fc which is the Unicode codepoint of the character.
Attachments
Issue Links
- relates to
-
QTBUG-69796 QKeyEvent: revise documentation
- Reported
-
QTBUG-65765 Unable to insert emoji in input fields using xdotool
- Closed
For Gerrit Dashboard: QTBUG-72776 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
251703,3 | qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
384842,2 | qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key() | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
384843,3 | qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key() | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |