X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FUSBKeyboard.py;h=4dee1f9197eb26d48f62d2c9dd3181c250af1306;hp=6e459e4f47f3fbdfc0b0933f240a52b3b4540a5f;hb=9a322fed4cbb324c54b582672d05f575f49a41cc;hpb=85180b93353582dd0cb8c344b6170192c858f86d diff --git a/client/USBKeyboard.py b/client/USBKeyboard.py index 6e459e4..4dee1f9 100644 --- a/client/USBKeyboard.py +++ b/client/USBKeyboard.py @@ -45,14 +45,17 @@ class USBKeyboardInterface(USBInterface): descriptors ) - # "ls" - self.text = [ chr(x) for x in [ 0x0f, 0x16, 0x28, 0x00 ] ] + # "ls" + empty_preamble = [ 0x00 ] * 10 + text = [ 0x0f, 0x00, 0x16, 0x00, 0x28, 0x00 ] + + self.keys = [ chr(x) for x in empty_preamble + text ] def handle_buffer_available(self): - if not self.text: + if not self.keys: return - letter = self.text.pop(0) + letter = self.keys.pop(0) self.type_letter(letter) def type_letter(self, letter, modifiers=0):