This message was posted on behalf of Intel Corporation
That's a nice question, I think that this is the function that you need: https://www.arduino.cc/en/Reference/KeyPressed, I recommend you to give it a try and let us know if it works. For more information about it you can check this link: https://github.com/arduino-libraries/USBHost. I can't assure you if it works, because there are some Arduino libraries that aren't compatible with the Intel Edison.
I hope you find this useful.