Simulate mouse / keyboard with Arduino / Genuino 101

Hi,

on a standard arduino, you can simulate a mouse or keyboard through the mouse & keyboard library.

However, on genuino 101, this library is not working. It simply does not compile.

I want to use the acceleration sensor of the genuino to simulate a mouse or keyboard via bluetooth or usb:
On a laptop, I have kind of “flappy birds”, space bar makes the bird jump.
The Genuino 101 should connect to the computer as keyboard and should simulate if accelerometer triggers.

Alternatively, I could communicate over serial with laptop, processing running there and simulating keypress when apropriate. However, I would prefer if the genuino 101 could simulate a keyboard.

Can somebody help?

Thanks, Markus

I don't think Genuino 101 has USB host capabilities...

Hi Markus, to become a Keyboard/Mouse an Arduino needs a programmable USB core (and native USB capabilities). Leonardo, Micro, Zero allow this kind of operations, while the 101 uses the x86 RTOS as an USB-to-serial converter so it can't be directly modified. If you feel brave, you could investigate how to enable x86 HID capabilities (the repository with the source code is here ); it's not an easy task but it's surely very rewarding :) !

Hi facchinm,

thanks for your answer!

If I understand your answer, the key is to modify https://downloadcenter.intel.com/download/25832 (investigating the link you gave I reached at some point an "end of development" notification).

So the plan is to enable HID capabilities in the above source code (the part you call "brave") and flash it back to genuino 101 (which is described in the readme file included in the sources).

Browsing around the source code a little bit, I get to understand what you mean by "feeling brave"...

There seems to be a lot of hid functionality:

arduino101_firmware_source-v1$ find | grep hid ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hid.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hidclass.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hidparse.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hid.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hidclass.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hidparse.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidsdi.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidpi.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidusage.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/ddk/include/ddk/hidclass.h ./arduino101_flashpack/source/dfu-utils/hidapi

but as you put, the key is to enable it.

Can you give me some further hints?

Thanks, Markus

aduino123: Hi facchinm,

thanks for your answer!

If I understand your answer, the key is to modify https://downloadcenter.intel.com/download/25832 (investigating the link you gave I reached at some point an "end of development" notification).

So the plan is to enable HID capabilities in the above source code (the part you call "brave") and flash it back to genuino 101 (which is described in the readme file included in the sources).

Browsing around the source code a little bit, I get to understand what you mean by "feeling brave"...

There seems to be a lot of hid functionality:

arduino101_firmware_source-v1$ find | grep hid ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hid.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hidclass.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib64/hidparse.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hid.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hidclass.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-crt/lib32/hidparse.def ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidsdi.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidpi.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/include/hidusage.h ./arduino101_flashpack/source/libwinpthread/mingw-w64-headers/ddk/include/ddk/hidclass.h ./arduino101_flashpack/source/dfu-utils/hidapi

but as you put, the key is to enable it.

Can you give me some further hints?

Thanks, Markus

I think you might want to either put an issue to Arduino IDE repository (which I have no idea where it actually is), or try to figure out how to import Keyboard.h file into your sketch. Since if you choose a board that's "factory-compatible" with those libs, it might require you to do some digging.

Hey - I'm looking to do something similar as well. To send some basic keystrokes as a BTLE Keyboard HID. This way, basic game controls can work on existing games otherwise I need to make some type of 'dongle' :-(

So for now I'll keep following https://blog.arduino.cc/2016/04/21/intel-releases-the-arduino-101-firmware-source-code/