marky1991
unread,Mar 27, 2013, 9:21:05 PM3/27/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to autokey-users
Okay, I think I managed to get it working properly. The only problem
left is arranging for the file to be opened on startup with access to
the autokey internals. he only thing I can think of is calling
run_script, which I obviously don't have access to. Is there a way to
tell autokey to run a script from the command line?
Also, here is the solution that I came up with. If you could look at
it and verify that it looks alright, I'd appreciate it.
class HotKey(iomediator.Waiter, object):
def __init__(self, key, modifiers, func):
super(HotKey, self).__init__(key, modifiers, None,
float("inf"))
self.func = func
def handle_keypress(self, key, modifiers, idk, *args):
if key == self.rawKey and modifiers == self.modifiers:
threading.Thread(target=self.func).start()
def off_monitor():
system.exec_command("/home/mark/Escritorio/off.sh")
kill_monitor = HotKey(iomediator.Key.F1, [iomediator.Key.CONTROL],
off_monitor)
store.set_value("mon", kill_monitor)