Skip to content

Commit

Permalink
Fixed|libgui|X11: Replaced use of deprecated XKeycodeToKeysym
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 21, 2014
1 parent e73e7ae commit a7d4169
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions doomsday/libgui/src/input/keyevent.cpp
Expand Up @@ -349,9 +349,19 @@ int de::KeyEvent::ddKeyFromQt(int qtKey, int nativeVirtualKey, int nativeScanCod
#ifdef XFREE_KEYMAPPING
static int x11ScancodeToDDKey(int scancode)
{
Display* disp = QX11Info::display();
KeySym sym = XKeycodeToKeysym(disp, scancode, 0);
int symCount;
KeySym *syms = XGetKeyboardMapping(QX11Info::display(), scancode, 1, &symCount);
if(!symCount)
{
XFree(syms);
return 0;
}
KeySym sym = syms[0];
XFree(syms);
syms = nullptr;

if(sym == NoSymbol) return 0;

unsigned int ucs4 = X11_KeySymToUcs4(sym);
if(ucs4)
{
Expand Down Expand Up @@ -433,7 +443,7 @@ KeyEvent::State KeyEvent::state() const
bool KeyEvent::isModifier() const
{
return _qtKey == Qt::Key_Shift || _qtKey == Qt::Key_Control ||
_qtKey == Qt::Key_Alt || _qtKey == Qt::Key_Meta;
_qtKey == Qt::Key_Alt || _qtKey == Qt::Key_Meta;
}

} // namespace de

0 comments on commit a7d4169

Please sign in to comment.