Example #1
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Select input device"))
		HelpableScreen.__init__(self)

		self.edittext = _("Press OK to edit the settings.")

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Select"))
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["introduction"] = StaticText(self.edittext)

		self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
		print("[InputDeviceSetup] found devices :->", len(self.devices),self.devices)

		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
			{
			"cancel": (self.close, _("Exit input device selection.")),
			"ok": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
			"red": (self.close, _("Exit input device selection.")),
			"green": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self.currentIndex = 0
		self.list = []
		self["list"] = List(self.list)
		self.updateList()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
Example #2
0
	def createConfig(self):
		self.name_list  = []
		self.mouse_list = None
		self.keyboard_list = None
		
		self.devices = [(x, iInputDevices.getDeviceName(x).replace("dreambox advanced remote control (native)", "Remote Control").replace("dreambox front panel", "Front Panel") + "(" + x  + ")") for x in iInputDevices.getDeviceList()]

		if self.conf_mouse == "":
			self.conf_mouse = "event1"
		self.mouse = ConfigSelection(default = self.conf_mouse, choices = self.devices)
		self.list.append(getConfigListEntry(_('Mouse'), _(self.mouse)))		

		if self.conf_keyboard == "":
			self.conf_keyboard = "event1"
		self.keyboard = ConfigSelection(default = self.conf_keyboard, choices = self.devices)
		self.list.append(getConfigListEntry(_('Keyboard'), _(self.keyboard)))

		if self.conf_alpha == "":
			self.conf_alpha = "255"
		self.alpha = ConfigSlider(default = int(self.conf_alpha), increment = 10, limits = (0, 255))
		self.list.append(getConfigListEntry(_("Alpha Value"), self.alpha))

		if self.conf_keymap == "":
			self.conf_keymap = self.getLanguage()
		self.lang_list = [("en", "English"), ("de", "German")]
		self.langs = ConfigSelection(default = self.conf_keymap, choices = self.lang_list)
		self.list.append(getConfigListEntry(_("Language"), self.langs))

		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #3
0
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)

		self.edittext = _("Press OK to edit the settings.")

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Select"))
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["introduction"] = StaticText(self.edittext)

		self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
		print "[InputDeviceSelection] found devices :->", len(self.devices),self.devices

		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
			{
			"cancel": (self.close, _("Exit input device selection.")),
			"ok": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
			"red": (self.close, _("Exit input device selection.")),
			"green": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self.currentIndex = 0
		self.list = []
		self["list"] = List(self.list)
		self.updateList()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
	def __init__(self, keys = []):
		self.keyaction = eActionMap.getInstance()
		self.rcdevicename = iInputDevices.getDeviceName('event0')
		self.keyTimer = eTimer()
		self.keyTimer.callback.append(self.cleanKeyList)
		self.keys = keys
		self.index = -1
 def __init__(self, keys=[]):
     self.keyaction = eActionMap.getInstance()
     self.rcdevicename = iInputDevices.getDeviceName('event0')
     self.keyTimer = eTimer()
     self.keyTimer.callback.append(self.cleanKeyList)
     self.keys = keys
     self.index = -1
Example #6
0
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.setTitle(_('Select input device'))
     self.edittext = _('Press OK to edit the settings.')
     self['key_red'] = StaticText(_('Close'))
     self['key_green'] = StaticText(_('Select'))
     self['key_yellow'] = StaticText('')
     self['key_blue'] = StaticText('')
     self['introduction'] = StaticText(self.edittext)
     self.devices = [(iInputDevices.getDeviceName(x), x)
                     for x in iInputDevices.getDeviceList()]
     print '[InputDeviceSelection] found devices :->', len(
         self.devices), self.devices
     self['OkCancelActions'] = HelpableActionMap(
         self, 'OkCancelActions', {
             'cancel': (self.close, _('Exit input device selection.')),
             'ok': (self.okbuttonClick, _('Select input device.'))
         }, -2)
     self['ColorActions'] = HelpableActionMap(
         self, 'ColorActions', {
             'red': (self.close, _('Exit input device selection.')),
             'green': (self.okbuttonClick, _('Select input device.'))
         }, -2)
     self.currentIndex = 0
     self.list = []
     self['list'] = List(self.list)
     self.updateList()
     self.onLayoutFinish.append(self.layoutFinished)
     self.onClose.append(self.cleanup)
Example #7
0
    def __init__(self, session, menu_path=""):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        menu_path += _("Input devices") + " / "
        screentitle = _("Select input device")
        menu_path += screentitle
        self.menu_path = menu_path + " / "
        if config.usage.show_menupath.value == 'large':
            title = menu_path
            self["menu_path_compressed"] = StaticText("")
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            self["menu_path_compressed"] = StaticText(
                menu_path +
                " >" if not menu_path.endswith(' / ') else menu_path[:-3] +
                " >" or "")
        else:
            title = screentitle
            self["menu_path_compressed"] = StaticText("")
        Screen.setTitle(self, title)

        self.edittext = _("Press OK to edit the settings.")

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Select"))
        self["key_yellow"] = StaticText("")
        self["key_blue"] = StaticText("")
        self["introduction"] = StaticText(self.edittext)

        self.devices = [(iInputDevices.getDeviceName(x), x)
                        for x in iInputDevices.getDeviceList()]
        print "[InputDeviceSetup] found devices :->", len(
            self.devices), self.devices

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.close, _("Exit input device selection.")),
                "ok": (self.okbuttonClick, _("Select input device.")),
            }, -2)

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.close, _("Exit input device selection.")),
                "green": (self.okbuttonClick, _("Select input device.")),
            }, -2)

        self.currentIndex = 0
        self.list = []
        self["list"] = List(self.list)
        self.updateList()
        self.onClose.append(self.cleanup)
Example #8
0
	def __init__(self, session, menu_path=""):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		menu_path += _("Input devices") + " / "
		screentitle = _("Select input device")
		menu_path += screentitle
		self.menu_path = menu_path + " / "
		if config.usage.show_menupath.value == 'large':
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)

		self.edittext = _("Press OK to edit the settings.")

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Select"))
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["introduction"] = StaticText(self.edittext)

		self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
		print "[InputDeviceSetup] found devices :->", len(self.devices),self.devices

		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
			{
			"cancel": (self.close, _("Exit input device selection.")),
			"ok": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
			"red": (self.close, _("Exit input device selection.")),
			"green": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self.currentIndex = 0
		self.list = []
		self["list"] = List(self.list)
		self.updateList()
		self.onClose.append(self.cleanup)
Example #9
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self.edittext = _("Press OK to edit the settings.")

        self["key_red"] = StaticText()
        self["key_green"] = StaticText(_("Keyboard"))
        txt = ""
        if InputDeviceManagement:
            txt = _("Connect")
        self["key_yellow"] = StaticText(txt)
        self["key_blue"] = StaticText(_("Advanced"))
        self["introduction"] = StaticText(self.edittext)

        self.devices = [(iInputDevices.getDeviceName(x), x)
                        for x in iInputDevices.getDeviceList()]
        print("[InputDeviceSelection] found devices :->", len(self.devices),
              self.devices)

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.close, _("Exit input device selection.")),
                "ok": (self.okbuttonClick, _("Select input device.")),
            }, -2)

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "green": (self._keyboardSetup, _("Set up your keyboard.")),
                "yellow":
                (self._openManager, _("Open Device Connection Manager")),
                "blue": (self._advanced, _("Setup Advanced Features")),
            }, -2)

        self.currentIndex = 0
        self.list = []
        self["list"] = List(self.list)
        self.updateList()
        self.onLayoutFinish.append(self.layoutFinished)
        self.onClose.append(self.cleanup)
Example #10
0
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.setTitle(_('Select input device'))
     self.edittext = _('Press OK to edit the settings.')
     self['key_red'] = StaticText(_('Close'))
     self['key_green'] = StaticText(_('Select'))
     self['key_yellow'] = StaticText('')
     self['key_blue'] = StaticText('')
     self['introduction'] = StaticText(self.edittext)
     self.devices = [ (iInputDevices.getDeviceName(x), x) for x in iInputDevices.getDeviceList() ]
     print '[InputDeviceSelection] found devices :->', len(self.devices), self.devices
     self['OkCancelActions'] = HelpableActionMap(self, 'OkCancelActions', {'cancel': (self.close, _('Exit input device selection.')),
      'ok': (self.okbuttonClick, _('Select input device.'))}, -2)
     self['ColorActions'] = HelpableActionMap(self, 'ColorActions', {'red': (self.close, _('Exit input device selection.')),
      'green': (self.okbuttonClick, _('Select input device.'))}, -2)
     self.currentIndex = 0
     self.list = []
     self['list'] = List(self.list)
     self.updateList()
     self.onLayoutFinish.append(self.layoutFinished)
     self.onClose.append(self.cleanup)
Example #11
0
    def createConfig(self):
        self.name_list = []
        self.mouse_list = None
        self.keyboard_list = None

        self.devices = [(x, iInputDevices.getDeviceName(x).replace(
            "dreambox advanced remote control (native)",
            "Remote Control").replace("dreambox front panel", "Front Panel") +
                         "(" + x + ")") for x in iInputDevices.getDeviceList()]

        if self.conf_mouse == "":
            self.conf_mouse = "event1"
        self.mouse = ConfigSelection(default=self.conf_mouse,
                                     choices=self.devices)
        self.list.append(getConfigListEntry(_('Mouse'), _(self.mouse)))

        if self.conf_keyboard == "":
            self.conf_keyboard = "event1"
        self.keyboard = ConfigSelection(default=self.conf_keyboard,
                                        choices=self.devices)
        self.list.append(getConfigListEntry(_('Keyboard'), _(self.keyboard)))

        if self.conf_alpha == "":
            self.conf_alpha = "255"
        self.alpha = ConfigSlider(default=int(self.conf_alpha),
                                  increment=10,
                                  limits=(0, 255))
        self.list.append(getConfigListEntry(_("Alpha Value"), self.alpha))

        if self.conf_keymap == "":
            self.conf_keymap = self.getLanguage()
        self.lang_list = [("en", "English"), ("de", "German")]
        self.langs = ConfigSelection(default=self.conf_keymap,
                                     choices=self.lang_list)
        self.list.append(getConfigListEntry(_("Language"), self.langs))

        self["config"].list = self.list
        self["config"].l.setList(self.list)
Example #12
0
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		
		self.edittext = _("Press OK to edit the settings.")
		
		self["key_red"] = StaticText()
		self["key_green"] = StaticText(_("Keyboard"))
		txt = ""
		if InputDeviceManagement:
			txt = _("Connect")
			self["key_yellow"] = StaticText(txt)
		self["key_blue"] = StaticText(_("Avanced"))
		self["introduction"] = StaticText(self.edittext)
		
		self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
		print "[InputDeviceSelection] found devices :->", len(self.devices),self.devices
			
		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
			{
			"cancel": (self.close, _("Exit input device selection.")),
			"ok": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
			"green": (self._keyboardSetup, _("Set up your keyboard.")),
			"yellow" : (self._openManager, _("Open Device Connection Manager")),
			"blue" : (self._advanced, _("Setup Advanced Features")),
			}, -2)

		self.currentIndex = 0
		self.list = []
		self["list"] = List(self.list)
		self.updateList()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
Example #13
0
def messageReceivedKey(address, message):
    logcmd = "[HDMI-CEC] received cec message part two %x from %x" % (message,
                                                                      address)
    if logcmd:
        if config.hdmicec.logenabledserial.value:
            print logcmd
            if config.hdmicec.logenabledfile.value:
                filelog = "echo %s >> /tmp/hdmicec.log" % (logcmd)
                system(filelog)
    if config.hdmicec.enabled.value is True:
        rcdevicename = iInputDevices.getDeviceName(
            'event0')  # hschang : get rc device name, /dev/input/event0
        keyaction = eActionMap.getInstance()
        key = None
        #start translate keycodes
        if message == 0x32 or message == 0x09:  #key menu
            key = int(139)
        elif message == 0x20:  #key 0
            key = int(11)
        elif message == 0x21:  #key 1
            key = int(2)
        elif message == 0x22:  #key 2
            key = int(3)
        elif message == 0x23:  #key 3
            key = int(4)
        elif message == 0x24:  #key 4
            key = int(5)
        elif message == 0x25:  #key 5
            key = int(6)
        elif message == 0x26:  #key 6
            key = int(7)
        elif message == 0x27:  #key 7
            key = int(8)
        elif message == 0x28:  #key 8
            key = int(9)
        elif message == 0x29:  #key 10
            key = int(10)
        elif message == 0x30:  #key bouquet up
            key = int(402)
        elif message == 0x31:  #key bouquet down
            key = int(403)
        elif message == 0x53:  #key info/epg
            key = int(358)
        elif message == 0x00:  #key ok
            key = int(352)
        elif message == 0x03:  #key left
            key = int(105)
        elif message == 0x04:  #key right
            key = int(106)
        elif message == 0x01:  #key up
            key = int(103)
        elif message == 0x02:  #key down
            key = int(108)
        elif message == 0x0d:  #key exit
            key = int(174)
        elif message == 0x72:  #key red
            key = int(398)
        elif message == 0x71:  #key blue
            key = int(401)
        elif message == 0x73:  #key green
            key = int(399)
        elif message == 0x74:  #key yellow
            key = int(400)
        elif message == 0x44:  #key play
            if rcdevicename.find("advanced"):
                key = int(164)  # KEY_PLAYPAUSE
            else:
                key = int(207)  # KEY_PLAY
        elif message == 0x46:  #key pause
            if rcdevicename.find("advanced"):
                key = int(164)  # KEY_PLAYPAUSE
            else:
                key = int(119)  # KEY_PAUSE
        elif message == 0x45:  #key stop
            key = int(128)
        elif message == 0x47:  #key record
            key = int(167)
        elif message == 0x49:  #fast forward
            if rcdevicename.find("advanced"):
                key = int(163)  # KEY_NEXTSONG
            else:
                key = int(208)  # KEY_FASTFORWARD
        elif message == 0x48:  #rewind
            if rcdevicename.find("advanced"):
                key = int(165)  # KEY_NEXTSONG
            else:
                key = int(168)  # KEY_FASTFORWARD
        elif message == 0x60:  #play 2
            key = int(207)
        elif message == 0x61:  #key pause 2
            if rcdevicename.find("advanced"):
                key = int(164)  # KEY_PLAYPAUSE
            else:
                key = int(119)  # KEY_PAUSE
        elif message == 0x64:  #key stop 2
            key = int(128)
        elif message == 0x62:  #key record 2
            key = int(167)
#end translate keycodes
        if key:
            keyaction.keyPressed(rcdevicename, key, int(0))
            keyaction.keyPressed(rcdevicename, key, int(1))
Example #14
0
def messageReceivedKey(address, message):

	logcmd = "[VTI HDMI-CEC] received cec message part two %x from %x" % (message, address)
	if logcmd:
		if config.hdmicec.logenabledserial.value:
			print logcmd
			if config.hdmicec.logenabledfile.value:
				filelog = "echo %s >> /tmp/hdmicec.log" % (logcmd)
				system(filelog)

	if config.hdmicec.enabled.value is True:
		rcdevicename = iInputDevices.getDeviceName('event0') # hschang : get rc device name, /dev/input/event0
		keyaction = eActionMap.getInstance()
		key = None
#start translate keycodes
		if message == 0x32 or message == 0x09: #key menu
			key = int(139)
		elif message == 0x20: #key 0
			key = int(11)
		elif message == 0x21: #key 1
			key = int(2)
		elif message == 0x22: #key 2
			key = int(3)
		elif message == 0x23: #key 3
			key = int(4)
		elif message == 0x24: #key 4
			key = int(5)
		elif message == 0x25: #key 5
			key = int(6)
		elif message == 0x26: #key 6
			key = int(7)
		elif message == 0x27: #key 7
			key = int(8)
		elif message == 0x28: #key 8
			key = int(9)
		elif message == 0x29: #key 10
			key = int(10)
		elif message == 0x30: #key bouquet up
			key = int(402)
		elif message == 0x31: #key bouquet down
			key = int(403)
		elif message == 0x53: #key info/epg
			key = int(358)
		elif message == 0x00: #key ok
			key = int(352)
		elif message == 0x03: #key left
			key = int(105)
		elif message == 0x04: #key right
			key = int(106)
		elif message == 0x01: #key up
			key = int(103)
		elif message == 0x02: #key down
			key = int(108)
		elif message == 0x0d: #key exit
			key = int(174)
		elif message == 0x72: #key red
			key = int(398)
		elif message == 0x71: #key blue
			key = int(401)
		elif message == 0x73: #key green
			key = int(399)
		elif message == 0x74: #key yellow
			key = int(400)
		elif message == 0x44: #key play
			if rcdevicename.find("advanced"):
				key = int(164) # KEY_PLAYPAUSE
			else:
				key = int(207) # KEY_PLAY
		elif message == 0x46: #key pause
			if rcdevicename.find("advanced"):
				key = int(164) # KEY_PLAYPAUSE
			else:
				key = int(119) # KEY_PAUSE
		elif message == 0x45: #key stop
			key = int(128)
		elif message == 0x47: #key record
			key = int(167)
		elif message == 0x49: #fast forward
			if rcdevicename.find("advanced"):
				key = int(163) # KEY_NEXTSONG
			else:
				key = int(208) # KEY_FASTFORWARD
		elif message == 0x48: #rewind
			if rcdevicename.find("advanced"):
				key = int(165) # KEY_NEXTSONG
			else:
				key = int(168) # KEY_FASTFORWARD
		elif message == 0x60: #play 2
			key = int(207)
		elif message == 0x61: #key pause 2
			if rcdevicename.find("advanced"):
				key = int(164) # KEY_PLAYPAUSE
			else:
				key = int(119) # KEY_PAUSE
		elif message == 0x64: #key stop 2
			key = int(128)
		elif message == 0x62: #key record 2
			key = int(167)
#end translate keycodes
		if key:
			keyaction.keyPressed(rcdevicename, key, int(0))
			keyaction.keyPressed(rcdevicename, key, int(1))