Any way to capture keyboard/mouse in an extension ?



Hi,
There is a feature I really miss in gnome-shell for work : being able
to make a window transparent : really nice to compare stuff.
Setting the opacity of a window is rather simple, but binding a
key/mouse combination is not.
i tried the following :
function change_opacity(actor,event) {
  log("scroll");
  return true;
}

function bind_scroll (display, window) {
  log("bind : "+window.get_title())
  window.get_compositor_private().connect('scroll-event',Lang.bind(window,change_opacity));
  return true;
}

function main() {
  let display = global.screen.get_display();
  display.connect_after('window-created',bind_scroll);
}

At the moment, I don't even try to play with a modifier, but the piece
of code above does not detect scrolling.
What's weird is that scroll event is a know signal for metawindows.

Do I have any chance to succeed ?
Thanks,
Thomas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]