At best this means you have to write some extra code with dedicated variables for the output key and output state with a group of ‘if’ statements to handle changes. The Arduino’s USB HID libraries work great – they make it easy to send Keyboard, Mouse, or Joystick inputs from your sketch, but they don’t do a great job of keeping track of which inputs you’re using and their state. Now instead of building yet another version of the same thing for my next project, I decided to turn it into a library instead. ![]() One of these bits I kept rebuilding was a wrapper class for the keyboard and mouse libraries that kept track of the keys I was using and their associated output states so that I could set them with a single line of code. ![]() As I keep working on a number of custom controllers using Arduino boards, I noticed that I tended to build the same sort of data structures every time things to make it easier to write my own code using the built-in Arduino libraries.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |