X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fepist.cc;h=3654150d62c3cd31f928900c57eeddf18046a5f9;hb=b94699afc339c469534521c44470aa6d19e5b4cc;hp=474d8fe8cdbcd9030e5f45d2d13fd137a1da1f76;hpb=24a1e215d1f8d2ff1674847278a15336d4b671b6;p=chaz%2Fopenbox diff --git a/util/epist/epist.cc b/util/epist/epist.cc index 474d8fe8..3654150d 100644 --- a/util/epist/epist.cc +++ b/util/epist/epist.cc @@ -1,5 +1,5 @@ // -*- mode: C++; indent-tabs-mode: nil; -*- -// epist.cc for Epistory - a key handler for NETWM/EWMH window managers. +// epist.cc for Epistophy - a key handler for NETWM/EWMH window managers. // Copyright (c) 2002 - 2002 Ben Jansens // // Permission is hereby granted, free of charge, to any person obtaining a @@ -38,9 +38,9 @@ extern "C" { # include #endif // HAVE_SIGNAL_H -/*#ifdef HAVE_LIBGEN_H +#ifdef HAVE_LIBGEN_H # include -#endif // HAVE_LIBGEN_H*/ +#endif // HAVE_LIBGEN_H } #include @@ -51,7 +51,6 @@ using std::endl; using std::string; #include "epist.hh" -#include "process.hh" #include "screen.hh" #include "window.hh" #include "../../src/XAtom.hh" @@ -76,6 +75,40 @@ 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::nextWorkspace, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + ControlMask)); + _actions.push_back(Action(Action::prevWorkspace, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + ControlMask | ShiftMask)); + _actions.push_back(Action(Action::toggleshade, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("F5")), + Mod1Mask)); + _actions.push_back(Action(Action::close, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("F4")), + Mod1Mask)); + _actions.push_back(Action(Action::nextWindow, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask)); + _actions.push_back(Action(Action::prevWindow, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask | ShiftMask)); + _actions.push_back(Action(Action::raise, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Up")), + Mod1Mask)); + _actions.push_back(Action(Action::lower, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Down")), + Mod1Mask)); + activateGrabs(); } @@ -83,6 +116,20 @@ epist::~epist() { delete _xatom; } +void epist::activateGrabs() { + + ScreenList::const_iterator scrit, scrend = _screens.end(); + + for (scrit = _screens.begin(); scrit != scrend; ++scrit) { + ActionList::const_iterator ait, end = _actions.end(); + + for(ait = _actions.begin(); ait != end; ++ait) { + XGrabKey(getXDisplay(), ait->keycode(), ait->modifierMask(), + (*scrit)->rootWindow(), False, GrabModeAsync, GrabModeAsync); + } + } +} + bool epist::handleSignal(int sig) { switch (sig) {