aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-events
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-27 08:20:14 -0400
committerKen Moore <ken@ixsystems.com>2017-06-27 08:20:14 -0400
commit79ed54ff31ed654b953d46987851ce4f572245c2 (patch)
treeb61de25f0ece7cfdb266f396a826b271c47ed0dd /src-qt5/core/lumina-desktop-unified/src-events
parentQuick fix for the mkport.sh script (diff)
downloadlumina-79ed54ff31ed654b953d46987851ce4f572245c2.tar.gz
lumina-79ed54ff31ed654b953d46987851ce4f572245c2.tar.bz2
lumina-79ed54ff31ed654b953d46987851ce4f572245c2.zip
Another large batch of re-organization for lumina-desktop-unified.
This gets the new "NativeWindowSystem" and associated Native* classes all integrated (untested)
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-events')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp49
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.h8
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-events/events.pri4
3 files changed, 26 insertions, 35 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp
index b09a1a5b..eb448f02 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.cpp
@@ -25,18 +25,9 @@ void LShortcutEvents::start(){
clearTimer->setSingleShot(true);
connect(clearTimer, SIGNAL(timeout()), this, SLOT(clearKeys()) );
}
- //Now connect this object to the global EFILTER object signals
- connect(Lumina::EFILTER, SIGNAL(KeyPressed(WId, int)), this, SLOT(KeyPress(WId, int)) );
- connect(Lumina::EFILTER, SIGNAL(KeyReleased(WId, int)), this, SLOT(KeyRelease(WId, int)) );
- connect(Lumina::EFILTER, SIGNAL(MousePressed(WId, Lumina::MouseButton)), this, SLOT(MousePress(WId, Lumina::MouseButton)) );
- connect(Lumina::EFILTER, SIGNAL(MouseReleased(WId, Lumina::MouseButton)), this, SLOT(MouseRelease(WId, Lumina::MouseButton)) );
}
void LShortcutEvents::stop(){
- disconnect(Lumina::EFILTER, SIGNAL(KeyPressed(WId, int)), this, SLOT(KeyPress(WId, int)) );
- disconnect(Lumina::EFILTER, SIGNAL(KeyReleased(WId, int)), this, SLOT(KeyRelease(WId, int)) );
- disconnect(Lumina::EFILTER, SIGNAL(MousePressed(WId, Lumina::MouseButton)), this, SLOT(MousePress(WId, Lumina::MouseButton)) );
- disconnect(Lumina::EFILTER, SIGNAL(MouseReleased(WId, Lumina::MouseButton)), this, SLOT(MouseRelease(WId, Lumina::MouseButton)) );
clearKeys();
}
@@ -59,42 +50,42 @@ void LShortcutEvents::CheckKeySequence(WId win){
}
}
-void LShortcutEvents::CheckMouseSequence(WId win, Lumina::MouseButton button, bool release){
- if(release && (button == Lumina::WheelUp || button == Lumina::WheelDown || button == Lumina::WheelLeft || button == Lumina::WheelRight)){
+void LShortcutEvents::CheckMouseSequence(WId win, NativeWindowSystem::MouseButton button, bool release){
+ if(release && (button == NativeWindowSystem::WheelUp || button == NativeWindowSystem::WheelDown || button == NativeWindowSystem::WheelLeft || button == NativeWindowSystem::WheelRight)){
return; //skip mouse release events for wheel actions (always come in pairs of press/release)
- }else if(keylist.isEmpty() || button == Lumina::NoButton){ return; } //Never overwrite mouse clicks themselves - just combinations with key presses
+ }else if(keylist.isEmpty() || button == NativeWindowSystem::NoButton){ return; } //Never overwrite mouse clicks themselves - just combinations with key presses
//Get the keyboard modifiers
QString shortcut = keylistToString();
//Add the mouse button to the shortcut
switch(button){
- case Lumina::LeftButton:
+ case NativeWindowSystem::LeftButton:
shortcut.append("+LeftMouse");
break;
- case Lumina::RightButton:
+ case NativeWindowSystem::RightButton:
shortcut.append("+RightMouse");
break;
- case Lumina::MidButton:
+ case NativeWindowSystem::MidButton:
shortcut.append("+MiddleMouse");
break;
- case Lumina::BackButton:
+ case NativeWindowSystem::BackButton:
shortcut.append("+BackMouse");
break;
- case Lumina::ForwardButton:
+ case NativeWindowSystem::ForwardButton:
shortcut.append("+ForwardMouse");
break;
- case Lumina::TaskButton:
+ case NativeWindowSystem::TaskButton:
shortcut.append("+TaskMouse");
break;
- case Lumina::WheelUp:
+ case NativeWindowSystem::WheelUp:
shortcut.append("+WheelUp");
break;
- case Lumina::WheelDown:
+ case NativeWindowSystem::WheelDown:
shortcut.append("+WheelDown");
break;
- case Lumina::WheelLeft:
+ case NativeWindowSystem::WheelLeft:
shortcut.append("+WheelLeft");
break;
- case Lumina::WheelRight:
+ case NativeWindowSystem::WheelRight:
shortcut.append("+WheelRight");
break;
default:
@@ -146,7 +137,7 @@ void LShortcutEvents::evaluateShortcutAction(QString action){
// === PUBLIC SLOTS ===
void LShortcutEvents::KeyPress(WId window, int key){
if(window!=WIN){ keylist.clear(); WIN = window; }
- if(!keylist.contains(key)){
+ if(!keylist.contains(key)){
//Put it in the list in ascending order
bool found = false;
for(int i=0; i<keylist.length() && !found; i++){
@@ -156,26 +147,26 @@ void LShortcutEvents::KeyPress(WId window, int key){
evaluated = false;
}
//Evaluate the key sequence only when the first one is released
- clearTimer->start(); //will "restart" if already running
+ clearTimer->start(); //will "restart" if already running
}
void LShortcutEvents::KeyRelease(WId window, int key){
if(window!=WIN){ keylist.clear(); return; }
if(!evaluated){ CheckKeySequence(WIN); } //run this "before" removing the key from the list
keylist.removeAll(key);
- clearTimer->start(); //will "restart" if already running
+ clearTimer->start(); //will "restart" if already running
}
-void LShortcutEvents::MousePress(WId window, Lumina::MouseButton button){
+void LShortcutEvents::MousePress(WId window, NativeWindowSystem::MouseButton button){
//We do not provide shortcuts for combinations of mouse buttons - just mouse+keyboard combinations
CheckMouseSequence(window, button, false);
- clearTimer->start(); //will "restart" if already running
+ clearTimer->start(); //will "restart" if already running
}
-void LShortcutEvents::MouseRelease(WId window, Lumina::MouseButton button){
+void LShortcutEvents::MouseRelease(WId window, NativeWindowSystem::MouseButton button){
//We do not provide shortcuts for combinations of mouse buttons - just mouse+keyboard combinations
CheckMouseSequence(window, button, true);
- clearTimer->start(); //will "restart" if already running
+ clearTimer->start(); //will "restart" if already running
}
void LShortcutEvents::clearKeys(){
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.h b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.h
index d1c3b4e0..a8ab4b38 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.h
+++ b/src-qt5/core/lumina-desktop-unified/src-events/LShortcutEvents.h
@@ -29,15 +29,15 @@ private:
//Actual check functions
void CheckKeySequence(WId win);
- void CheckMouseSequence(WId win, Lumina::MouseButton, bool release);
+ void CheckMouseSequence(WId win, NativeWindowSystem::MouseButton, bool release);
QString keylistToString();
void evaluateShortcutAction(QString action);
public slots:
void KeyPress(WId window, int key);
void KeyRelease(WId window, int key);
- void MousePress(WId window, Lumina::MouseButton);
- void MouseRelease(WId window, Lumina::MouseButton);
+ void MousePress(WId window, NativeWindowSystem::MouseButton);
+ void MouseRelease(WId window, NativeWindowSystem::MouseButton);
void clearKeys();
signals:
@@ -50,7 +50,7 @@ signals:
// Session Options
void ChangeWorkspace(int); // +/- 1 from current
void LockSession();
-
+
//Active Window Options
void ActiveWindowMoveToWorkspace(int); //number of workspace
void ActiveWindowTakeToWorkspace(int); //number of workspace
diff --git a/src-qt5/core/lumina-desktop-unified/src-events/events.pri b/src-qt5/core/lumina-desktop-unified/src-events/events.pri
index 9eec91ca..48d500ed 100644
--- a/src-qt5/core/lumina-desktop-unified/src-events/events.pri
+++ b/src-qt5/core/lumina-desktop-unified/src-events/events.pri
@@ -1,6 +1,6 @@
-SOURCES *= $${PWD}/LXcbEventFilter.cpp
+#SOURCES *= $${PWD}/LXcbEventFilter.cpp
-HEADERS *= $${PWD}/LXcbEventFilter.h
+#HEADERS *= $${PWD}/LXcbEventFilter.h
#Shortcut event files
SOURCES *= $${PWD}/LShortcutEvents.cpp
bgstack15