(key)
| 152 | |
| 153 | |
| 154 | def on_press(key): |
| 155 | if key == keyboard.Key.esc: |
| 156 | return False # stop listener |
| 157 | try: |
| 158 | k = key.char # single-char keys |
| 159 | except: |
| 160 | k = key.name # other keys |
| 161 | if k in ["1", "2", "left", "right"]: # keys of interest |
| 162 | # self.keys.append(k) # store it in global-like variable |
| 163 | print("Key pressed: " + k) |
| 164 | return False # stop listener; remove this if want more keys |
| 165 | |
| 166 | |
| 167 | # Run Application with Voice Command Function |
nothing calls this directly
no outgoing calls
no test coverage detected