Ejemplo n.º 1
0
    def __init__(self):
        InputPlugin.__init__(self)

        self.config = freevo.config.input.plugin.joystick

        self.device_name = self.config.device

        blocked = self.get_resources('JOYSTICK')
        if len(blocked) != 0:
            # FIXME maybe different joysticks possible?
            log.error("Joystick is allready used, can't start joystick plugin")
            return

        for mapping in self.config.events:
            self.KEYMAP[mapping.input] = mapping.event
        try:
            self.joyfd = os.open(self.device_name, os.O_RDONLY|os.O_NONBLOCK)
        except OSError:
#            reason = 'Unable to open %s' % self.device_name
            log.error('Could not open joystick interface (%s)'%self.device_name)
            self.free_resources()
            return

        self.socket_dispatcher = kaa.IOMonitor(self.handle)
        self.socket_dispatcher.register(self.joyfd)
        self.timer = kaa.OneShotTimer(self.axis)
        self.movement = {}
        self.events = {}
Ejemplo n.º 2
0
    def __init__(self):
        InputPlugin.__init__(self)

        self.config = freevo.config.input.plugin.joystick

        self.device_name = self.config.device

        blocked = self.get_resources('JOYSTICK')
        if len(blocked) != 0:
            # FIXME maybe different joysticks possible?
            log.error("Joystick is allready used, can't start joystick plugin")
            return

        for mapping in self.config.events:
            self.KEYMAP[mapping.input] = mapping.event
        try:
            self.joyfd = os.open(self.device_name, os.O_RDONLY | os.O_NONBLOCK)
        except OSError:
            #            reason = 'Unable to open %s' % self.device_name
            log.error('Could not open joystick interface (%s)' %
                      self.device_name)
            self.free_resources()
            return

        self.socket_dispatcher = kaa.IOMonitor(self.handle)
        self.socket_dispatcher.register(self.joyfd)
        self.timer = kaa.OneShotTimer(self.axis)
        self.movement = {}
        self.events = {}
Ejemplo n.º 3
0
 def plugin_activate(self, level):
     """
     Active X11 input layer
     """
     InputPlugin.plugin_activate(self, level)
     gui.signals["key-press"].connect(self.handle)
     self.keymap = copy.deepcopy(KEYBOARD_MAP)
     for key, mapping in freevo.config.input.plugin.keyboard.mapping.items():
         self.keymap[key] = mapping.upper()
Ejemplo n.º 4
0
 def __init__(self):
     InputPlugin.__init__(self)
     kaa.input.lirc.init('freevo', freevo.config.input.plugin.lirc.lircrc)
     kaa.input.lirc.signal.connect(self.post_key)
Ejemplo n.º 5
0
 def __init__(self):
     InputPlugin.__init__(self)
     kaa.input.lirc.init('freevo', freevo.config.input.plugin.lirc.lircrc)
     kaa.input.lirc.signal.connect(self.post_key)