explicitly specify python3; add preamble and debouncing to keyboard emulator to suppo...
authorpete-cs <pete-cs@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 16 Jun 2013 00:45:22 +0000 (00:45 +0000)
committerpete-cs <pete-cs@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sun, 16 Jun 2013 00:45:22 +0000 (00:45 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1600 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/USBKeyboard.py
client/facedancer-keyboard.py
client/facedancer-monitor.py

index 6e459e4..4dee1f9 100644 (file)
@@ -45,14 +45,17 @@ class USBKeyboardInterface(USBInterface):
                 descriptors
         )
 
                 descriptors
         )
 
-        # "ls<ENTER><KEY UP>"
-        self.text = [ chr(x) for x in [ 0x0f, 0x16, 0x28, 0x00 ] ]
+        # "l<KEY UP>s<KEY UP><ENTER><KEY UP>"
+        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):
 
     def handle_buffer_available(self):
-        if not self.text:
+        if not self.keys:
             return
 
             return
 
-        letter = self.text.pop(0)
+        letter = self.keys.pop(0)
         self.type_letter(letter)
 
     def type_letter(self, letter, modifiers=0):
         self.type_letter(letter)
 
     def type_letter(self, letter, modifiers=0):
index 549d1b1..58b87d0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.2
+#!/usr/bin/env python3
 #
 # usb-test.py
 
 #
 # usb-test.py
 
index 1edc152..906c044 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.2
+#!/usr/bin/env python3
 #
 # monitor-test.py
 
 #
 # monitor-test.py