Skip to content

Commit

Permalink
[VirtualKeyBoard.py] Restore processSelect method name
Browse files Browse the repository at this point in the history
Clarify the separation of the OK remote control button from the selection action code

Provide interface for YouTubeVirtualKeyBoard plugin. Hopefully that plugin will adopt the more appropriate naming.

This change restores compatibility with the other copies of this code in other images.
  • Loading branch information
IanSav authored and littlesat committed Sep 4, 2018
1 parent f641216 commit c1c369a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/python/Screens/VirtualKeyBoard.py
Expand Up @@ -326,7 +326,7 @@ def __init__(self, session, title=_("Virtual KeyBoard Text:"), text="", maxSize=
"save": (self.save, _("Save any text changes and exit")),
"locale": (self.localeMenu, _("Select the virtual keyboard locale from a menu")),
"shift": (self.shiftClicked, _("Select the virtual keyboard shifted character set")),
"ok": (self.okClicked, _("Select the character or action under the virtual keyboard cursor")),
"select": (self.processSelect, _("Select the character or action under the virtual keyboard cursor")),
"up": (self.up, _("Move the virtual keyboard cursor up")),
"left": (self.left, _("Move the virtual keyboard cursor left")),
"right": (self.right, _("Move the virtual keyboard cursor right")),
Expand Down Expand Up @@ -575,7 +575,7 @@ def unitedKingdom(self, base):

def smsGotChar(self):
if self.smsChar and self.selectAsciiKey(self.smsChar):
self.okClicked()
self.processSelect()

def setLocale(self):
self.language, self.location, self.keyList = self.locales.get(self.lang, [None, None, None])
Expand Down Expand Up @@ -640,7 +640,10 @@ def markSelectedKey(self):
self.previousSelectedKey = self.selectedKey
self["list"].setList(self.list)

def okClicked(self):
def okClicked(self): # Deprecated legacy interface to new processSelect used by YouTubeVirtualKeyBoard
self.processSelect()

def processSelect(self):
self.smsChar = None
text = self.keyList[self.shiftLevel][self.selectedKey / self.keyboardWidth][self.selectedKey % self.keyboardWidth].encode("UTF-8")
if text == u"":
Expand Down Expand Up @@ -781,7 +784,7 @@ def keyNumberGlobal(self, number):
def keyGotAscii(self):
self.smsChar = None
if self.selectAsciiKey(str(unichr(getPrevAsciiCode()).encode("utf-8"))):
self.okClicked()
self.processSelect()

def selectAsciiKey(self, char):
if char == u" ":
Expand Down

0 comments on commit c1c369a

Please sign in to comment.