def keyReleaseEvent(self, event): keyboard.send_message(json.dumps({ 'press': False, 'code': event.nativeScanCode(), }))
def keyPressEvent(self, event): keyboard.send_message(json.dumps({ 'press': True, 'code': event.nativeScanCode(), }))