summaryrefslogtreecommitdiff
path: root/util/epist/epist.cc
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-07-19 13:11:27 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-07-19 13:11:27 +0000
commitf586e55a8cd3d740a1b7b3a0801bad27030926f9 (patch)
treed9a6889fbb1f4088af2b56b3ddc0934acd7f2a26 /util/epist/epist.cc
parent0326ac961fb82d8d7aab22e4da1859adeeceb2f7 (diff)
Added an action class and started the even handler.
Diffstat (limited to 'util/epist/epist.cc')
-rw-r--r--util/epist/epist.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/epist/epist.cc b/util/epist/epist.cc
index 7be2ae31..2dcacba5 100644
--- a/util/epist/epist.cc
+++ b/util/epist/epist.cc
@@ -75,6 +75,16 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
cout << "No compatible window manager found on any screens. Aborting.\n";
::exit(1);
}
+
+ _actions.push_back(Action(Action::nextDesktop,
+ XKeysymToKeycode(getXDisplay(),
+ XStringToKeysym("Tab")),
+ Mod1Mask));
+ _actions.push_back(Action(Action::prevDesktop,
+ XKeysymToKeycode(getXDisplay(),
+ XStringToKeysym("Tab")),
+ ControlMask));
+ activateGrabs();
}
@@ -82,7 +92,24 @@ epist::~epist() {
delete _xatom;
}
+// XGrabKey(_epist->getXDisplay(), XKeysymToKeycode(_epist->getXDisplay(),
+// XStringToKeysym("F5")),
+// Mod1Mask, _root, True, GrabModeAsync, GrabModeAsync);
+
+void epist::activateGrabs() {
+
+ ScreenList::const_iterator scrit, scrend = _screens.end();
+
+ for (scrit = _screens.begin(); scrit != scrend; ++scrit) {
+ ActionList::const_iterator end = _actions.end();
+ for(ActionList::const_iterator ait = _actions.begin();
+ ait != end; ++ait) {
+ XGrabKey(getXDisplay(), ait->keycode(), ait->modifierMask(),
+ (*scrit)->rootWindow(), True, GrabModeAsync, GrabModeAsync);
+ }
+ }
+}
bool epist::handleSignal(int sig) {
switch (sig) {
case SIGHUP: