Commit 59fcf8df authored by Saul Ibarra's avatar Saul Ibarra

Fixed processing DTMF tones


On Windows event.key() always returns the key code regardless
of the modifiers that where used, unlike Linux. On Windows both 3 and
Shift+3 give a 51 code, whereas on Linux 3 gives 51 but Shift+3 gives 35.
So, lets use the unicode representation of the typed charcter.
parent e8145a51
......@@ -2212,8 +2212,8 @@ class AudioSessionListView(QListView):
self.context_menu.hide()
def keyPressEvent(self, event):
digit = chr(event.key()) if event.key() < 256 else None
if digit is not None and digit in string.digits+string.uppercase+'#*':
digit = event.text()
if digit and digit in string.digits+string.uppercase+'#*':
letter_map = {'2': 'ABC', '3': 'DEF', '4': 'GHI', '5': 'JKL', '6': 'MNO', '7': 'PQRS', '8': 'TUV', '9': 'WXYZ'}
letter_map = dict(chain(*(izip(letters, repeat(digit)) for digit, letters in letter_map.iteritems())))
for session in (s for s in self.model().sessions if s.active):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment