def cancel(self): self.registry.deregisterKeystrokeListener(self.__processKeyEvent, mask=pyatspi.allModifiers()) self.registry.deregisterEventListener(self.__processMouseEvent, 'mouse:button') self.registry.stop() XInterfaceBase.cancel(self)
def __init__(self): ''' Constructor for the L{HotkeyManager} ''' gtk.ListStore.__init__(self, str, str, object, int, int, str) self.connect('row-changed', self._onComboChanged) masks = [mask for mask in pyatspi.allModifiers()] pyatspi.Registry.registerKeystrokeListener( self._accEventKeyPressed, mask=masks, kind=(pyatspi.KEY_PRESSED_EVENT,))
def __init__(self): ''' Constructor for the L{HotkeyManager} ''' gtk.ListStore.__init__(self, str, str, object, int, int, str) self.connect('row-changed', self._onComboChanged) masks = [mask for mask in pyatspi.allModifiers()] pyatspi.Registry.registerKeystrokeListener( self._accEventKeyPressed, mask=masks, kind=(pyatspi.KEY_PRESSED_EVENT, ))
def cancel(self): self.registry.deregisterKeystrokeListener(self.__processKeyEvent, mask=pyatspi.allModifiers()) self.registry.deregisterEventListener(self.__processMouseEvent, "mouse:button") self.registry.stop() XInterfaceBase.cancel(self)
def start(self): logger.info("AT-SPI interface thread starting") self.registry.registerKeystrokeListener(self.__processKeyEvent, mask=pyatspi.allModifiers()) self.registry.registerEventListener(self.__processMouseEvent, "mouse:button")
def start(self): logger.info("AT-SPI interface thread starting") self.registry.registerKeystrokeListener(self.__processKeyEvent, mask=pyatspi.allModifiers()) self.registry.registerEventListener(self.__processMouseEvent, 'mouse:button')
presage.PresageCallback.__init__(self) self.buffer = '' def get_past_stream(self): return self.buffer def get_future_stream(self): return '' # Presage owns callback, so we create it and disown it callback = SimpleCallback().__disown__() prsg = presage.Presage(callback) prediction = prsg.predict() reg.registerKeystrokeListener(process_event, mask=pyatspi.allModifiers()) window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("delete-event", delete_event) window.connect("window-state-event", frame_event) window.set_keep_above(True) #window.set_decorated(False) window.move(window_position_x, window_position_y) window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#c0c0ff")) label = gtk.Label("pypresagemate") label.set_justify(gtk.JUSTIFY_LEFT) label.set_width_chars(20)
#!/usr/bin/python import gi from gi.repository import GLib gi.require_version('Gst', '1.0') from gi.repository import Gst import time, threading gi.require_version('Atspi', '2.0') import pyatspi # Callback to print the active window on key press amd filter out the key release def on_key_input(event): print(event) mainloop = GLib.MainLoop() thread = threading.Thread(target=mainloop.run) thread.start() #pyatspi.Registry.registerKeystrokeListener(on_key_input, kind=(pyatspi.KEY_PRESSED_EVENT, pyatspi.KEY_RELEASED_EVENT)) pyatspi.Registry.registerKeystrokeListener(on_key_input, mask=pyatspi.allModifiers(), kind=(pyatspi.KEY_PRESS, pyatspi.KEY_RELEASE, pyatspi.KEY_PRESSRELEASE), synchronous=True, preemptive=True) pyatspi.Registry.start()
def run(self): pyatspi.Registry.registerKeystrokeListener( handler, kind=(pyatspi.KEY_PRESSED_EVENT, ), mask=pyatspi.allModifiers()) pyatspi.Registry.start()
def run(self): pyatspi.Registry.registerKeystrokeListener(handler, kind=(pyatspi.KEY_PRESSED_EVENT,), mask=pyatspi.allModifiers()) pyatspi.Registry.start()
#!/usr/bin/python import gi from gi.repository import GLib gi.require_version('Gst', '1.0') from gi.repository import Gst import time, threading gi.require_version('Atspi', '2.0') import pyatspi # Callback to print the active window on key press amd filter out the key release def on_key_input(event): print(event) mainloop = GLib.MainLoop() thread = threading.Thread(target=mainloop.run) thread.start() #pyatspi.Registry.registerKeystrokeListener(on_key_input, kind=(pyatspi.KEY_PRESSED_EVENT, pyatspi.KEY_RELEASED_EVENT)) pyatspi.Registry.registerKeystrokeListener(on_key_input,mask=pyatspi.allModifiers(), kind=(pyatspi.KEY_PRESS,pyatspi.KEY_RELEASE,pyatspi.KEY_PRESSRELEASE), synchronous=True, preemptive=True) pyatspi.Registry.start()
return '' # Presage owns callback, so we create it and disown it callback = SimpleCallback().__disown__() prsg = presage.Presage(callback) number_of_suggestions = prsg.config("Presage.Selector.SUGGESTIONS") "limit suggestions to 10 as that should be enough for anybody :-)" if int(number_of_suggestions) > int(10): number_of_suggestions = 10 prsg.config("Presage.Selector.SUGGESTIONS", "10") prediction = prsg.predict() reg.registerKeystrokeListener(process_event, mask=pyatspi.allModifiers()) window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("delete-event", delete_event) window.connect("window-state-event", frame_event) window.set_keep_above(True) #window.set_decorated(False) window.move(window_position_x, window_position_y) window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#c0c0ff")) label = gtk.Label("pypresagemate") label.set_justify(gtk.JUSTIFY_LEFT) label.set_width_chars(20)