The loop() function continuously listens for newline-terminated strings on the serial port. It then uses a pretty basic if/else-if chain to turn these into HID inputs. The Arduino responds "OK\n" on ...