From b8cf98b78b993fa0072192af46a5cde81b8bfd7e Mon Sep 17 00:00:00 2001 From: Peter Jensen Date: Mon, 12 Feb 2018 12:57:54 +0100 Subject: [PATCH] src/trezor/ui/passphrase: keyboard fix multitouch on space --- src/trezor/ui/passphrase.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/trezor/ui/passphrase.py b/src/trezor/ui/passphrase.py index 81522806..9522aad2 100644 --- a/src/trezor/ui/passphrase.py +++ b/src/trezor/ui/passphrase.py @@ -122,16 +122,18 @@ class PassphraseKeyboard(ui.Widget): return content for btn in self.keys: if btn.touch(event, pos) == BTN_CLICKED: - # key press, add new char to input or cycle the pending button - if self.pbutton is btn: - index = (self.pindex + 1) % len(btn.content) - content = content[:-1] + btn.content[index] + if isinstance(btn.content[0], str): + # key press, add new char to input or cycle the pending button + if self.pbutton is btn: + index = (self.pindex + 1) % len(btn.content) + content = content[:-1] + btn.content[index] + else: + index = 0 + content += btn.content[0] else: index = 0 - if isinstance(btn.content[0], str): - content += btn.content[0] - else: - content += ' ' + content += ' ' + self.edit(content, btn, index) return