Exemple #1
0
def OnMouseDown(event):
    global rightMousePressed
    global superPressed
    global frame

    mouse = settings.get('mouse')
    if not mouse:
        mouse = 'middle'

    if event.MessageName == 'mouse ' + mouse + ' down':
        rightMousePressed = True

        if settings.get('default_key'):
            if superPressed:
                start_new_thread(record_mouse_pos, ())
        else:
            start_new_thread(record_mouse_pos, ())
Exemple #2
0
def OnMouseDown(event):
    global rightMousePressed
    global superPressed
    global frame
    
    mouse = settings.get('mouse')
    if not mouse:
        mouse = 'middle'

    if event.MessageName == 'mouse ' + mouse + ' down':
        rightMousePressed = True
        
        if settings.get('default_key'):
            if superPressed:
                start_new_thread(record_mouse_pos, ())
        else:
            start_new_thread(record_mouse_pos, ())
Exemple #3
0
def OnMoseUp(event):
    mouse = settings.get('mouse')
    global window_name
    window_name = (event.WindowName, event.WindowProcName) 
    if not mouse:
        mouse = 'middle'
    if event.MessageName == 'mouse ' + mouse + ' up':
        global rightMousePressed
        rightMousePressed = False
Exemple #4
0
def OnMoseUp(event):
    mouse = settings.get('mouse')
    global window_name
    window_name = (event.WindowName, event.WindowProcName)
    if not mouse:
        mouse = 'middle'
    if event.MessageName == 'mouse ' + mouse + ' up':
        global rightMousePressed
        rightMousePressed = False
Exemple #5
0
def find_gesture(gesture):
    global window_name
    app_gesture = gestures.find_gesture(window_name, gesture)
    if app_gesture == []:
        key = settings.get(gesture)
    else:
        key = str(app_gesture[0][0])

    if key:
        import os
        os.system('xsendkeys +'+key)
Exemple #6
0
def find_gesture(gesture):
    global window_name
    app_gesture = gestures.find_gesture(window_name, gesture)
    if app_gesture == []:
        key = settings.get(gesture)
    else:
        key = str(app_gesture[0][0])

    if key:
        import os
        os.system('xsendkeys +' + key)
Exemple #7
0
def OnKeyUp(event):
    global superPressed
    if event.Key == settings.get('default_key'):
        superPressed = False
Exemple #8
0
def OnKeyDown(event):
    global superPressed

    if event.Key == settings.get('default_key'):
        superPressed = True
Exemple #9
0
 def __init__(self):
     super(SettingsFrame, self).__init__()
     
     self.set_title(self.TITLE)
     self.set_position(gtk.WIN_POS_CENTER)
     self.set_border_width(10)
     self.set_resizable(False)
     # Set icons on buttons
     #settings = gtk.settings_get_default()
     #settings.props.gtk_button_images = True
     
     #hbox1 = gtk.HBox(False, 0)
     #hbox2 = gtk.HBox(False, 10)
     #hbox3 = gtk.HBox(False, 10)
     vbox = gtk.VBox(False, 10)
     
     #valign = gtk.Alignment(0, 1, 0, 0)
     #vbox.pack_start(valign)
     
     frame = gtk.Frame("Settings")
     
     self.table = gtk.Table(4, 4, False)
     self.table.set_col_spacings(10)
     self.table.set_border_width(10) 
     label = gtk.Label("Set default key:")
     label.set_alignment(1,0.5)
     self.set = gtk.Button(str(settings.get("default_key")))
     self.set.connect("clicked", self.on_set)
     clear = gtk.Button("Clear")
     clear.connect('clicked', self.on_clear)
     self.table.attach(clear, 2,3, 1,2)
     
     self.table.attach(label, 0, 1, 1, 2)
     self.table.attach(self.set, 1, 2, 1, 2)
     
     self.table.attach(gtk.Label("Set mouse button:"), 0,1,2,3)
     selectMouse = gtk.combo_box_new_text()
     for c in self.MOUSE:
         selectMouse.append_text(c.capitalize())
     selectMouse.connect('changed', self.on_changed_cb)
     
     mouse = settings.get('mouse')
     if mouse:
         selectMouse.set_active(self.MOUSE.index(mouse))
     
     self.table.attach(selectMouse,1,2,2,3)
     
     configGestures = gtk.Button("Config Gestures")
     configGestures.connect('clicked', self.on_config_gestures)
     cf = gtk.Label("Config gestures:")
     cf.set_alignment(1,0.5)
     self.table.attach(cf, 0,1,4,5)
     self.table.attach(configGestures, 1,2,4,5)
     
     
     close = gtk.Button(stock=gtk.STOCK_CLOSE)
     close.connect('clicked', self.on_close)
     align = gtk.Alignment(xalign=1.0, yalign=0.5)
     align.add(close)
     vbox.pack_end_defaults(align)
     
     frame.add(self.table)
     vbox.pack_start_defaults(frame)
     vbox.pack_end_defaults(align)
     
     halign = gtk.Alignment(0, 1, 0, 0)
             
     self.add(vbox)
     
     
     self.connect("destroy", self.on_close)
     self.show_all()
Exemple #10
0
def OnKeyUp(event):
    global superPressed
    if event.Key == settings.get('default_key'):
        superPressed = False
Exemple #11
0
def OnKeyDown(event):
    global superPressed

    if event.Key == settings.get('default_key'):
        superPressed = True
Exemple #12
0
    def __init__(self):
        super(settingsGmsFrame, self).__init__()
        self.no_saving = True
        self.set_title(self.TITLE)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_border_width(10)
        self.set_resizable(False)
        
        # Set icons on buttons
        #settings = gtk.settings_get_default()
        #settings.props.gtk_button_images = True
        
        vbox = gtk.VBox(False, 10)
        hbox = gtk.HBox(False, 10)
        
        


        self.COMBINATIONS = ['left', 'right', 'up', 'down', 
                        'up-left', 'up-right', 'down-left', 'down-right' 
                       ]
                       
        frame = gtk.Frame("Global settings")  
        self.table = gtk.Table(2, 2, False)
        self.table.set_col_spacings(10)
        self.table.set_border_width(10)  
        for i,c in enumerate(self.COMBINATIONS):
            label = gtk.Label(c.capitalize())
            label.set_alignment(1,0.5)
            self.table.attach(label, 0,1,i,i+1)
            
            entry = gtk.Entry()
            key = settings.get(c.replace('-', ''))
            entry.set_name(c)
            if key:
                entry.set_text(key)
            entry.connect('changed', self.on_global_changed)
            self.table.attach(entry, 1,2, i, i+1)
            
        frame.add(self.table)        
        
        frame_local = gtk.Frame("Application specific settings")
        
        self.table2 = gtk.Table(2, 2, False)
        self.table2.set_col_spacings(10)
        self.table2.set_border_width(10) 
        label = gtk.Label("Choose a program:")
        label.set_alignment(1,0.5)
        self.select_program = gtk.combo_box_new_text()
        self.select_program.connect('changed', self.on_select_change)
        self.refresh_app_list()
        
        self.add_text = gtk.Entry()
        
        add_label = gtk.Label("Add a new app")
        
        add_button = gtk.Button("Add")
        add_button.connect('clicked', self.on_add_app)
        
        self.remove_button = gtk.Button("Remove")
        self.remove_button.set_sensitive(False)
        self.remove_button.connect('clicked', self.on_remove_app)
        
        self.table2.attach(add_label, 0,1,0,1)
        self.table2.attach(self.add_text, 1,2,0,1)
        self.table2.attach(add_button, 2,3, 0,1)
        self.table2.attach(self.remove_button, 2,3,1,2)
        self.table2.attach(label, 0,1,1,2)
        self.table2.attach(self.select_program, 1,2,1,2)
        
        for i,c in enumerate(self.COMBINATIONS):
            label = gtk.Label(c.capitalize())
            label.set_alignment(1,0.5)
            self.table2.attach(label, 0,1,i+2,i+3)
            
            entry = gtk.Entry()
            entry.connect('changed', self.on_specific_changed)
            
            entry.set_name(c)
            
            self.table2.attach(entry, 1,2, i+2, i+3)
        frame_local.add(self.table2)
        hbox.pack_start_defaults(frame)
        hbox.pack_start_defaults(frame_local)
        vbox.pack_start_defaults(hbox)
        close = gtk.Button(stock=gtk.STOCK_CLOSE)
        close.connect('clicked', self.on_close)
        align = gtk.Alignment(xalign=1.0, yalign=0.5)
        align.add(close)
        vbox.pack_end_defaults(align)
        
        #self.add(table)
        
        #vbox.pack_end(table, True, True, 0)
        self.add(vbox)
        #self.down = gtk.Entry()
        #self.down.set_text(settings.get('down'))
        
        self.connect("destroy", self.on_close)
        self.show_all()
Exemple #13
0
    def __init__(self):
        super(SettingsFrame, self).__init__()

        self.set_title(self.TITLE)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_border_width(10)
        self.set_resizable(False)
        # Set icons on buttons
        #settings = gtk.settings_get_default()
        #settings.props.gtk_button_images = True

        #hbox1 = gtk.HBox(False, 0)
        #hbox2 = gtk.HBox(False, 10)
        #hbox3 = gtk.HBox(False, 10)
        vbox = gtk.VBox(False, 10)

        #valign = gtk.Alignment(0, 1, 0, 0)
        #vbox.pack_start(valign)

        frame = gtk.Frame("Settings")

        self.table = gtk.Table(4, 4, False)
        self.table.set_col_spacings(10)
        self.table.set_border_width(10)
        label = gtk.Label("Set default key:")
        label.set_alignment(1, 0.5)
        self.set = gtk.Button(str(settings.get("default_key")))
        self.set.connect("clicked", self.on_set)
        clear = gtk.Button("Clear")
        clear.connect('clicked', self.on_clear)
        self.table.attach(clear, 2, 3, 1, 2)

        self.table.attach(label, 0, 1, 1, 2)
        self.table.attach(self.set, 1, 2, 1, 2)

        self.table.attach(gtk.Label("Set mouse button:"), 0, 1, 2, 3)
        selectMouse = gtk.combo_box_new_text()
        for c in self.MOUSE:
            selectMouse.append_text(c.capitalize())
        selectMouse.connect('changed', self.on_changed_cb)

        mouse = settings.get('mouse')
        if mouse:
            selectMouse.set_active(self.MOUSE.index(mouse))

        self.table.attach(selectMouse, 1, 2, 2, 3)

        configGestures = gtk.Button("Config Gestures")
        configGestures.connect('clicked', self.on_config_gestures)
        cf = gtk.Label("Config gestures:")
        cf.set_alignment(1, 0.5)
        self.table.attach(cf, 0, 1, 4, 5)
        self.table.attach(configGestures, 1, 2, 4, 5)

        close = gtk.Button(stock=gtk.STOCK_CLOSE)
        close.connect('clicked', self.on_close)
        align = gtk.Alignment(xalign=1.0, yalign=0.5)
        align.add(close)
        vbox.pack_end_defaults(align)

        frame.add(self.table)
        vbox.pack_start_defaults(frame)
        vbox.pack_end_defaults(align)

        halign = gtk.Alignment(0, 1, 0, 0)

        self.add(vbox)

        self.connect("destroy", self.on_close)
        self.show_all()