On Wed, Aug 8, 2012 at 8:55 PM, Kerrick Staley <m...@kerrickstaley.com> wrote: > Hi, > I'm trying to write an extension that will toggle the overview > whenever mouse button 9 is clicked, but I can't figure out how to > detect clicks from arbitrary locations on the screen.
You cannot. X does not work that way. You could take a button grab, but XGrabKeys isn't introspectable, and we don't have introspectable bindings for it. > global.stage's button-press-event will fire when you click the mouse > anywhere within the overview, but when the overview is hidden, only > clicks on the panel will cause button-press-event to fire. > > My current code follows: > > const Main = imports.ui.main; > const Lang = imports.lang; > > function init() { } > > function enable() { > global.stage.connect('button-press-event', Lang.bind(this, > function(actor, event) { > if (event.get_button() == 9) > this._toggleOverview(); > })); > } > > function disable() { } > > function _toggleOverview() { > if (Main.overview.visible) > Main.overview.hide(); > else > Main.overview.show(); > } > > - Kerrick > _______________________________________________ > gnome-shell-list mailing list > gnome-shell-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gnome-shell-list -- Jasper _______________________________________________ gnome-shell-list mailing list gnome-shell-list@gnome.org https://mail.gnome.org/mailman/listinfo/gnome-shell-list