So I would like to use a Arduino Leonardo to create a keyboard with some common complex terminal commands. I understand how I should do this project, but one issue i'm having trouble with is to detect if the command is comming from the Arduino or if a command comes from my usual keyboard.
When the Arduino Leonardo sends a keypres via the USB port. Is there any flag showing it comes from an Arduino? or are the keys sent exactly the same as from a regular keyboard?
I could look at what USB port the command is coming from. But then the Arduino needs to use the same port everytime so I rather not do this.
When the Arduino Leonardo sends a keypres via the USB port. Is there any flag showing it comes from an Arduino?
Yes, but not an easily detectable.
or are the keys sent exactly the same as from a regular keyboard?
Yes, that's the intention. The keys are sent exactly as if the Arduino is a regular keyboard. From a technical point of view the Arduino is a regular keyboard.
I could look at what USB port the command is coming from. But then the Arduino needs to use the same port everytime so I rather not do this.
This sounds as you would like to distinguish between the Arduino and a standard keyboard. Why would you like to do that?