summaryrefslogtreecommitdiffstats
path: root/src/pvs.cpp
diff options
context:
space:
mode:
authorSebastien Braun2010-10-04 00:22:14 +0200
committerSebastien Braun2010-10-05 18:15:48 +0200
commit266eb5fb14c07e67aa211a5860e9abf3009136e3 (patch)
tree9eeb8b159edf6e83880c056f1177cebec2ad354c /src/pvs.cpp
parentDefect #715, apply patch by Sébastien (diff)
downloadpvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.tar.gz
pvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.tar.xz
pvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.zip
Implement first version of basic input event support
Diffstat (limited to 'src/pvs.cpp')
-rw-r--r--src/pvs.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp
index 2069e36..e44d04d 100644
--- a/src/pvs.cpp
+++ b/src/pvs.cpp
@@ -15,6 +15,9 @@
#include "src/net/pvsMsg.h"
#include "src/net/pvsServiceDiscovery.h"
#include "src/net/pvsDiscoveredServer.h"
+#include "src/input/inputEvent.h"
+#include "src/input/unprivilegedHandlerChain.h"
+#include "src/input/x11InputUtils.h"
// D-Bus
#include "pvsadaptor.h"
@@ -76,6 +79,7 @@ PVS::PVS() :
sigaction(SIGINT, &act, 0);
sigaction(SIGQUIT, &act, 0);
+ initializeInputEventHandling();
}
PVS::~PVS()
@@ -176,6 +180,12 @@ void PVS::onCommand(PVSMsg cmdMessage)
unlock();
return;
}
+ if (ident.compare("INPUTEVENT") == 0)
+ {
+ InputEvent evt;
+ eventFromString(message, evt);
+ handleInputEvent(evt);
+ }
#ifdef never
// prototype
@@ -627,3 +637,17 @@ void PVS::signalHandler(int signal)
}
+// Input handling
+
+void PVS::handleInputEvent(InputEvent const& evt)
+{
+ std::string s = evt.toString();
+ ConsoleLog writeLine(QString("Received input event: %1").arg(s.c_str()));
+ unprivileged_handler_chain::handle(evt);
+}
+
+void PVS::initializeInputEventHandling()
+{
+ X11InputUtils::setDisplay(X11Info::display());
+ unprivileged_handler_chain::initialize();
+}