Esempio n. 1
0
 def cancel(self):
     self.registry.deregisterKeystrokeListener(self.__processKeyEvent,
                                               mask=pyatspi.allModifiers())
     self.registry.deregisterEventListener(self.__processMouseEvent,
                                           'mouse:button')
     self.registry.stop()
     XInterfaceBase.cancel(self)
Esempio n. 2
0
  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,))
Esempio n. 3
0
    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, ))
Esempio n. 4
0
 def cancel(self):
     self.registry.deregisterKeystrokeListener(self.__processKeyEvent, mask=pyatspi.allModifiers())
     self.registry.deregisterEventListener(self.__processMouseEvent, "mouse:button")
     self.registry.stop()
     XInterfaceBase.cancel(self)
Esempio n. 5
0
 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")
Esempio n. 6
0
 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')
Esempio n. 7
0
      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)
Esempio n. 8
0
#!/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()
Esempio n. 9
0
 def run(self):
     pyatspi.Registry.registerKeystrokeListener(
         handler,
         kind=(pyatspi.KEY_PRESSED_EVENT, ),
         mask=pyatspi.allModifiers())
     pyatspi.Registry.start()
Esempio n. 10
0
File: linux.py Progetto: Oire/TWBlue
 def run(self):
  pyatspi.Registry.registerKeystrokeListener(handler, kind=(pyatspi.KEY_PRESSED_EVENT,),
  mask=pyatspi.allModifiers())
  pyatspi.Registry.start()
Esempio n. 11
0
#!/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()
Esempio n. 12
0
      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)