Open fehmud opened 12 years ago
Sorry for the late reply.
If you run it in the CLI does it output any sort of errors and/or Exceptions? If so please post them here. I haven't touched the script in a while something might have changed on the dependency chain.
On 07/29/2012 11:43 AM, Fábio André Damas wrote:
Sorry for the late reply.
If you run it in the CLI does it output any sort of errors and/or Exceptions? If so please post them here. I haven't touched the script in a while something might have changed on the dependency chain.
Reply to this email directly or view it on GitHub: https://github.com/skkeeper/linux-clicky/issues/1#issuecomment-7351402
Thank you for replying.
I always ran the script from the terminal, and neither warnings nor errors were displayed.
Cheers.
Hello again,
If you can please re-download the project and run it again, it should output some type of error now.
Thanks for your time :)
Done. Here it is what I got:
$ sudo python main.py [sudo] password for egarrulo:
Gasp! What happened to my program? I checked the syntax of Markdown and here it is again:
#! /usr/bin/env python
from Xlib.display import Display
from Xlib import X
Control_R = 64 # Keycode for right Control.
Control_L = 108 # Keycode for left Control.
# Keycodes we are listening for. I've left out Right Control
# to be able to stop the program.
keycodes = [Control_L]
# Handle X events.
def handle_event(event):
# Let us know whether this event is about a Key Release of
# one of the keys in which we are interested.
if event.type == X.KeyRelease:
keycode = event.detail
if keycode in keycodes:
print "KeyRelease"
# Objects needed to call Xlib.
display = Display()
root = display.screen().root
# Tell the X server we want to catch KeyRelease events.
root.change_attributes(event_mask = X.KeyReleaseMask)
# Grab those keys.
for keycode in keycodes:
root.grab_key(keycode, X.AnyModifier, 1, X.GrabModeAsync, X.GrabModeAsync)
# Event loop.
while 1:
event = root.display.next_event()
handle_event(event)
# End of program.
Hello,
thank you for writing and sharing this useful utility.
After checking that all the dependencies were satisfied, I tried running the script on my system, but it stopped working after a few key presses. Rebooting fixed the issue, but only momentarily.
I tried more than once, with the same results.
Launching the gnome-system-monitor showed a lot of "play" and "sh" sleeping processes and a "python" one. I was able to end only the "python" process.
I wish I were a Python developer, to be able to give more help.
Cheers.
Software:
Python: 2.7.3 Debian GNU/Linux: 6.0.5 Gnome Version: 2.30.2 Linux Kernel: 2.6.32-5-686