I have tried using Keyboard.write, Keyboard.press and Keyboard.release, which do not accept unit8_t inputs.
size_t write(uint8_t k); size_t write(const uint8_t *buffer, size_t size); size_t press(uint8_t k); size_t release(uint8_t k);
buf = 0; // modifier bits, shift, ctrl, alt, win buf = 0; // always 0 buf = 4; // A key code buf = 0; // buf = 0; // buf = 0; // buf = 0; // buf = 0; // HID().SendReport(2, buf, 8);
Hello,I have successfully programmed an Arduino Uno to act as a keyboard. When coupled with a Titan 2, I can then use it for PS4 adaptive controls. The function I used to send the 'keystrokes' for the Arduino Uno was Serial.write(buf, 8 ), where buf was a unit8_t consisting of the ASCII codes for the given buttons pressed ( 0 or null if not pressed). Now that I would like to do the same task with the Leonardo (cost savings and ease of board configuration) I have tried using Keyboard.write, Keyboard.press and Keyboard.release, which do not accept unit8_t inputs. I have tried multiple different arrangements of the three functions. I have ended up with individual lines of code, for example:Keyboard.press(buf);Keyboard.press(buf);Keyboard.press(buf);Keyboard.press(buf);Keyboard.press(buf);Keyboard.press(buf);Keyboard.releaseAll();Keyboard.write with a delay acts exactly as a keyboard, however cause serious glitching on the Titan 2 (gaming controls very unresponsive). Keyboard.Press and Keyboard.releaseall (as above), type multiple characters for one press, but drastically reduced the glitchiness on the Titan 2. Which is good but not perfect. I have a hunch that reducing the amount of data being sent to the Titan 2, by finding the correct format to use Keyboard.write in one line of code, would do the trick. Any thoughts?