Hi! Good afternoon!

I'm trying to write a client for an online flash game as we don't have any clients for linux. (We can just play by using the browser. Maybe someone wrote any for personal use only, I don't know.)

So, everything works so far but I can't type any characters that use accents like "é" or any other dead-keys. When I press "´" first and then "e", nothing happens.
Note: These characters works normally on normal HTML inputs.

I've tested the code on an flash demo online that contains text input and it also does not work with Qt Webkit, but works on Chromium.

I'm using Linux amd64 with KDE and the problem happens with Qt 5.2.1 and Qt 5.3, both amd64, if I remember correctly it works with Qt 4.8 without problems, but the game goes somewhat slow in Qt 4.8. With Qt 5.3 it's faster than Chromium.

Here's a minimal sample code for reproducing the problem:
Qt Code:
  1. #include <QApplication>
  2. #include <QWebView>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7.  
  8. QWebView web;
  9. web.settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
  10. web.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
  11. web.load(QUrl("http://www.flex-component.com/demo/kctextarea/"));
  12. web.show();
  13.  
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

Solutions I've tried:
- Install an event filter on QApplication.
Result: The dead-keys only gets KeyRelease events and no KeyPress events.

- Send these keys using QApplication::postEvent.
Result: Nothing changes, same problem.

- Generate the KeyPress events for these keys and call QWebPage::event.
Result: Works for every other key, but not for dead-keys. Same problem.

- Enumerate X11 windows and send the keystrokes directly using Xlib or xcb (I've tried both).
Result: The code still gets inside Qt event loop and nothing happens, same problem.
Extra info: I think I've got only the QWebPage or QWebView X handle.

- Explicitly setting QLocale to Brazilian Portuguese. (I'm Brazilian but I prefer to use English language on my system)
Result: Nothing changes, same problem.

My next option would be loading the flash plugin without Qt WebKit at all but it's a lot of work and I'm not sure if it'll be good as the webkit implementation which just works fine. I'm afraid of getting more problems and losing too much time and resolving just one problem. Anyway, I'll try this later.

Also: "ç" just works fine, maybe because it's an existing key on my keyboard layout, so I'll guess this isn't a problem with the keyboard layout being different for flash player only. (It does get KeyPress and KeyRelease as every key.)

Is there any way or any workaround to make these keys works? Or any function/flags I could try to fix this problem?