class InfoBarUnhandledKey:
def __init__(self):
self.unhandledKeyDialog = self.session.instantiateDialog(UnhandledKey)
- self.hideTimer = eTimer()
- self.hideTimer.callback.append(self.unhandledKeyDialog.hide)
+ self.hideUnhandledKeySymbolTimer = eTimer()
+ self.hideUnhandledKeySymbolTimer.callback.append(self.unhandledKeyDialog.hide)
self.checkUnusedTimer = eTimer()
self.checkUnusedTimer.callback.append(self.checkUnused)
self.onLayoutFinish.append(self.unhandledKeyDialog.hide)
eActionMap.getInstance().bindAction('', -0x7FFFFFFF, self.actionA) #highest prio
eActionMap.getInstance().bindAction('', 0x7FFFFFFF, self.actionB) #lowest prio
- self.key = -1;
- self.flags = 0;
+ self.flags = (1<<1);
self.uflags = 0;
#this function is called on every keypress!
def actionA(self, key, flag):
if flag != 4:
- if self.key != key:
- if self.checkUnusedTimer.isActive():
- self.checkUnusedTimer.stop()
- self.checkUnused()
- self.key = key
+ if self.flags & (1<<1):
self.flags = self.uflags = 0
self.flags |= (1<<flag)
if flag == 1: # break
def checkUnused(self):
if self.flags == self.uflags:
self.unhandledKeyDialog.show()
- self.hideTimer.start(2000, True)
+ self.hideUnhandledKeySymbolTimer.start(2000, True)
class InfoBarShowHide:
""" InfoBar show/hide control, accepts toggleShow and hide actions, might start