diff --git a/mtda/keyboard/qemu.py b/mtda/keyboard/qemu.py index e97353d3..d36feabd 100644 --- a/mtda/keyboard/qemu.py +++ b/mtda/keyboard/qemu.py @@ -42,10 +42,23 @@ def idle(self): def press(self, key, repeat=1): self.mtda.debug(3, "keyboard.qemu.press()") + symbols = { + ',': 'comma', + '.': 'dot', + '*': 'asterisk', + '/': 'slash', + '-': 'minus', + '=': 'equal', + ' ': 'spc', + '\t': 'tab', + '\n': 'ret' + } + result = True while repeat > 0: repeat = repeat - 1 - self.qemu.cmd("sendkey %s" % key) + key = symbols[key] if key in symbols else key + self.qemu.cmd("sendkey {}".format(key)) time.sleep(0.1) return result