Answer the question
In order to leave comments, you need to log in
Intercepting mouse and keyboard events in Gnome?
This solution is taken from here .
<font color="#008000"><strong>from</strong></font> <font color="#0000FF"><strong>Xlib.display</strong></font> <font color="#008000"><strong>import</strong></font> Display<br/> <font color="#008000"><strong>from</strong></font> <font color="#0000FF"><strong>Xlib</strong></font> <font color="#008000"><strong>import</strong></font> X<br/> display <font color="#666666">=</font> Display(<font color="#BA2121">':0'</font>)<br/> root <font color="#666666">=</font> display<font color="#666666">.</font>screen()<font color="#666666">.</font>root<br/> root<font color="#666666">.</font>grab_pointer(<font color="#008000">True</font>, X<font color="#666666">.</font>ButtonPressMask <font color="#666666">|</font> X<font color="#666666">.</font>ButtonReleaseMask, X<font color="#666666">.</font>GrabModeAsync, X<font color="#666666">.</font>GrabModeAsync, <font color="#666666">0</font>, <font color="#666666">0</font>, X<font color="#666666">.</font>CurrentTime)<br/> <font color="#008000"><strong>while</strong></font> <font color="#008000">True</font>:<br/> <font color="#008000"><strong>print</strong></font> <font color="#BA2121">"Event:"</font><br/> <font color="#008000"><strong>print</strong></font> display<font color="#666666">.</font>next_event()<br/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question