X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fepist.cc;h=6e954aec9a787fd0ae60d0a1347a852d144fd4ca;hb=a0e50e15b507f1f8752bd7858c9e758265a34fc4;hp=b0eefaa85439adbeaa5795f99b643e45951710a7;hpb=836d93624cd75887af918b059e57dd3fd3f1e445;p=chaz%2Fopenbox diff --git a/util/epist/epist.cc b/util/epist/epist.cc index b0eefaa8..6e954aec 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 @@ -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: