diff options
author | Ken Moore <ken@ixsystems.com> | 2017-07-07 14:59:20 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-07-07 14:59:20 -0400 |
commit | 0c406639a823f4cad097c8e5a98606658d44bbf4 (patch) | |
tree | f36c4d0d27db78eeaddf47eb8838828913c6c389 /src-qt5/core/libLumina | |
parent | update to readme (diff) | |
download | lumina-0c406639a823f4cad097c8e5a98606658d44bbf4.tar.gz lumina-0c406639a823f4cad097c8e5a98606658d44bbf4.tar.bz2 lumina-0c406639a823f4cad097c8e5a98606658d44bbf4.zip |
Commit a work-in-progress for converting an X11 keycode into a Qt::Key definition
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.pri | 2 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.cpp | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.pri b/src-qt5/core/libLumina/NativeWindow.pri index b10e472c..fef9c736 100644 --- a/src-qt5/core/libLumina/NativeWindow.pri +++ b/src-qt5/core/libLumina/NativeWindow.pri @@ -1,7 +1,7 @@ # Files QT *= x11extras -LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lXdamage +LIBS *= -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lxcb-keysyms -lXdamage SOURCES *= $${PWD}/NativeWindow.cpp \ $${PWD}/NativeWindowSystem.cpp \ diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp index a8fb550e..6f737b27 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.cpp +++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp @@ -27,6 +27,7 @@ #include <xcb/xcb_aux.h> #include <xcb/composite.h> #include <xcb/damage.h> +#include <xcb/xcb_keysyms.h> //XLib includes (XCB Damage lib does not appear to register for damage events properly) #include <X11/extensions/Xdamage.h> @@ -250,7 +251,13 @@ void NativeWindowSystem::stop(){ //Small simplification functions Qt::Key NativeWindowSystem::KeycodeToQt(int keycode){ - qDebug() << "Try to convert keycode to Qt::Key:" << keycode; + static xcb_key_symbols_t *SYM = 0; + if(SYM==0){ SYM = xcb_key_symbols_alloc(QX11Info::connection()); } + xcb_keysym_t symbol = xcb_key_symbols_get_keysym(SYM, keycode,0); + //not sure about the "column" input - we want raw keys though so ignore the "modified" key states (columns) for now + qDebug() << "Try to convert keycode to Qt::Key:" << keycode << symbol; + //Now map this symbol to the appropriate Qt::Key enumeration + qDebug() << " -- Simple Qt Map:" << (Qt::Key)(symbol); qDebug() << " - Not implemented yet"; return Qt::Key_unknown; } @@ -802,6 +809,7 @@ void NativeWindowSystem::GotPong(WId id){ void NativeWindowSystem::NewKeyPress(int keycode, WId win){ emit NewInputEvent(); if(screenLocked){ return; } + KeycodeToQt(keycode); emit KeyPressDetected(win, keycode); } |