X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fbindings.cc;h=253e13837585b5c7cde99e4f024e811d95067719;hb=c34f2a5241fba850f3e48a08ebeff3190c6dc9d5;hp=4a2e7db8e08e31f22115d71807fb1452a6e68996;hpb=77ab46d1e35d48e73c201e6de88b26f48bb06425;p=chaz%2Fopenbox diff --git a/src/bindings.cc b/src/bindings.cc index 4a2e7db8..253e1383 100644 --- a/src/bindings.cc +++ b/src/bindings.cc @@ -23,15 +23,15 @@ namespace ob { static bool buttonvalue(const std::string &button, unsigned int *val) { - if (button == "1" || button == "Button1") { + if (button == "Left" || button == "1" || button == "Button1") { *val |= Button1; - } else if (button == "2" || button == "Button2") { + } else if (button == "Middle" || button == "2" || button == "Button2") { *val |= Button2; - } else if (button == "3" || button == "Button3") { + } else if (button == "Right" || button == "3" || button == "Button3") { *val |= Button3; - } else if (button == "4" || button == "Button4") { + } else if (button == "Up" || button == "4" || button == "Button4") { *val |= Button4; - } else if (button == "5" || button == "Button5") { + } else if (button == "Down" || button == "5" || button == "Button5") { *val |= Button5; } else return false; @@ -145,7 +145,7 @@ KeyBindingTree *Bindings::buildtree(const StringVect &keylist, Bindings::Bindings() : _curpos(&_keytree), _resetkey(0,0), - _timer(Openbox::instance->timerManager(), + _timer(openbox->timerManager(), (otk::TimeoutHandler)resetChains, this) { _timer.setTimeout(5000); // chains reset after 5 seconds @@ -341,7 +341,7 @@ void Bindings::removeAllKeys() void Bindings::grabKeys(bool grab) { - for (int i = 0; i < Openbox::instance->screenCount(); ++i) { + for (int i = 0; i < openbox->screenCount(); ++i) { Window root = otk::Display::screenInfo(i)->rootWindow(); KeyBindingTree *p = _curpos->first_child; @@ -387,7 +387,7 @@ void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key, grabKeys(true); otk::Display::ungrab(); } else { - Client *c = Openbox::instance->focusedClient(); + Client *c = openbox->focusedClient(); KeyData data(screen, c, time, modifiers, key); CallbackList::iterator it, end = p->callbacks.end(); for (it = p->callbacks.begin(); it != end; ++it) @@ -440,8 +440,8 @@ bool Bindings::addButton(const std::string &but, MouseContext context, bind->binding.modifiers = b.modifiers; _buttons[context].push_back(bind); // grab the button on all clients - for (int sn = 0; sn < Openbox::instance->screenCount(); ++sn) { - Screen *s = Openbox::instance->screen(sn); + for (int sn = 0; sn < openbox->screenCount(); ++sn) { + Screen *s = openbox->screen(sn); Client::List::iterator c_it, c_end = s->clients.end(); for (c_it = s->clients.begin(); c_it != c_end; ++c_it) { grabButton(true, bind->binding, context, *c_it); @@ -466,8 +466,8 @@ void Bindings::removeAllButtons() } } // ungrab the button on all clients - for (int sn = 0; sn < Openbox::instance->screenCount(); ++sn) { - Screen *s = Openbox::instance->screen(sn); + for (int sn = 0; sn < openbox->screenCount(); ++sn) { + Screen *s = openbox->screen(sn); Client::List::iterator c_it, c_end = s->clients.end(); for (c_it = s->clients.begin(); c_it != c_end; ++c_it) { grabButton(false, (*it)->binding, (MouseContext)i, *c_it);