X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fepist.cc;h=3fb064631d3ade4bd04f78e33577fff548a8ab3a;hb=c9be3ee06121bc4d0dec3586918607f18dabdb89;hp=7be2ae316a8315c5269b42ceb8928ebdbce7f64d;hpb=043e42a316e67183a3210035f238e872e020996a;p=chaz%2Fopenbox diff --git a/util/epist/epist.cc b/util/epist/epist.cc index 7be2ae31..3fb06463 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 @@ -75,6 +75,28 @@ 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::nextWindow, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask)); + _actions.push_back(Action(Action::prevWindow, + XKeysymToKeycode(getXDisplay(), + XStringToKeysym("Tab")), + Mod1Mask | ShiftMask)); + activateGrabs(); } @@ -82,6 +104,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) {