X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FUSBKeyboard.py;h=2d5f99e7a4acb4b526a200b9795cf45905194d84;hp=6e459e4f47f3fbdfc0b0933f240a52b3b4540a5f;hb=0c1cae929512565296940bf6322087a73b2cecd0;hpb=85180b93353582dd0cb8c344b6170192c858f86d diff --git a/client/USBKeyboard.py b/client/USBKeyboard.py index 6e459e4..2d5f99e 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): @@ -61,7 +64,7 @@ class USBKeyboardInterface(USBInterface): if self.verbose > 2: print(self.name, "sending keypress 0x%02x" % ord(letter)) - self.device.maxusb_app.send_on_endpoint(3, data) + self.configuration.device.maxusb_app.send_on_endpoint(3, data) class USBKeyboardDevice(USBDevice):