A couple suggestions on the Arduino code:

Instead of setting a pin as an input and then pulling it high, you can set the pin as INPUT_PULLUP. Additionally, you may want to add Keyboard.begin() to the end of the setup block.