Skip to content

Commit

Permalink
Revert "X11: Try to translate some key codes natively"
Browse files Browse the repository at this point in the history
This reverts commit 442bca1.

Seems to work better without taking native key codes for X11 now.
  • Loading branch information
hluk committed Dec 20, 2015
1 parent d47d078 commit 61db89d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/platform/x11/x11platform.cpp
Expand Up @@ -24,7 +24,6 @@
#include <QApplication>
#include <QCoreApplication>
#include <QDir>
#include <QKeySequence>
#include <QRegExp>
#include <QVariant>
#include <QWidget>
Expand Down Expand Up @@ -235,23 +234,3 @@ PlatformClipboardPtr X11Platform::clipboard()

return PlatformClipboardPtr(new X11PlatformClipboard(d));
}

int X11Platform::keyCode(const QKeyEvent &event)
{
if (d->display()) {
quint32 keyCode = event.nativeScanCode();

int keysyms_per_keycode_return;
KeySym *keysym = XGetKeyboardMapping(d->display(), keyCode, 1, &keysyms_per_keycode_return);
char *text = XKeysymToString(*keysym);
XFree(keysym);

if (text) {
const QKeySequence shortcut(text, QKeySequence::NativeText);
if (!shortcut.isEmpty())
return shortcut[0];
}
}

return PlatformNativeInterface::keyCode(event);
}
2 changes: 0 additions & 2 deletions src/platform/x11/x11platform.h
Expand Up @@ -69,8 +69,6 @@ class X11Platform : public PlatformNativeInterface

PlatformClipboardPtr clipboard();

int keyCode(const QKeyEvent &event);

private:
QSharedPointer<X11DisplayGuard> d;
};
Expand Down

0 comments on commit 61db89d

Please sign in to comment.