aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-07-07 14:59:20 -0400
committerKen Moore <ken@ixsystems.com>2017-07-07 14:59:20 -0400
commit0c406639a823f4cad097c8e5a98606658d44bbf4 (patch)
treef36c4d0d27db78eeaddf47eb8838828913c6c389 /src-qt5
parentupdate to readme (diff)
downloadlumina-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')
-rw-r--r--src-qt5/core/libLumina/NativeWindow.pri2
-rw-r--r--src-qt5/core/libLumina/NativeWindowSystem.cpp10
-rw-r--r--src-qt5/core/lumina-desktop-unified/LSession.cpp15
3 files changed, 11 insertions, 16 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);
}
diff --git a/src-qt5/core/lumina-desktop-unified/LSession.cpp b/src-qt5/core/lumina-desktop-unified/LSession.cpp
index 8b4d352f..584c60a8 100644
--- a/src-qt5/core/lumina-desktop-unified/LSession.cpp
+++ b/src-qt5/core/lumina-desktop-unified/LSession.cpp
@@ -88,20 +88,7 @@ void LSession::setupSession(){
//Setup the QSettings default paths
splash.showScreen("settings");
if(DEBUG){ qDebug() << " - Init QSettings:" << timer->elapsed();}
- DesktopSettings::instance()->start();
- /*sessionsettings = new QSettings("lumina-desktop", "sessionsettings");
- DPlugSettings = new QSettings("lumina-desktop","pluginsettings/desktopsettings");
- //Load the proper translation files
- if(sessionsettings->value("ForceInitialLocale",false).toBool()){
- //Some system locale override it in place - change the env first
- LUtils::setLocaleEnv( sessionsettings->value("InitLocale/LANG","").toString(), \
- sessionsettings->value("InitLocale/LC_MESSAGES","").toString(), \
- sessionsettings->value("InitLocale/LC_TIME","").toString(), \
- sessionsettings->value("InitLocale/LC_NUMERIC","").toString(), \
- sessionsettings->value("InitLocale/LC_MONETARY","").toString(), \
- sessionsettings->value("InitLocale/LC_COLLATE","").toString(), \
- sessionsettings->value("InitLocale/LC_CTYPE","").toString() );
- }*/
+ DesktopSettings::instance(); //don't do anything other than init/start the static object here
if(DEBUG){ qDebug() << " - Load Localization Files:" << timer->elapsed();}
currTranslator = LUtils::LoadTranslation(this, "lumina-desktop");
if(DEBUG){ qDebug() << " - Start Event Filter:" << timer->elapsed(); }
bgstack15