HID Core , keyboard availability question

Can i use keyboard.write with spark core ?

I know arduino uno can not do it , leonardo only can do that . but what about spark core ?

Having tried the ā€œsearchā€ option, this came up: https://community.spark.io/t/usb-hid-support-on-core/
Perhaps youā€™ll find some more information there, and if not, you can at least ask the responsible people.

@Gentmat, Iā€™ve mainly been playing with HID Mouse on the Core and this works quite nicely.
About the HID Keyboard support, itā€™s still quite rudimentary.
You can Keyboard.write() but only one character/key at a time and if you want to use other than US keyboard layout, you may have to alter some key mappings.

AFAIK, to use it, youā€™ll still have to build locally.

As I have not used vanilla Arduino HIDs but Teensy, Iā€™m not sure what the Arduino has to offer, but Iā€™m missing Teensyā€™s multi HID support (Mouse + Keyboard + Serial), absolute mouse (like digitizer tablets) and to Keyboard.write()/.print() whole strings (while this last one would be easy to add yourself, by using the already available functions).

"I've mainly been playing with HID Mouse on the Core and this works quite nicely. "
what library or code you used to play with mouse ?
any example please

Itā€™s not a library but a branch of the core-firmware
So you have to fork/clone this branch, write your own application.cpp, build that firmware and upload it to the Core.
@satishgn has done a great job putting this together and he might have some idea if/when this feature might make it into compile-server2 for WebIDE use.

Hate to resurrect an old thread but @ScruffR would you mind sharing your application.cpp/.h that you have been using to test this feature? I know how to pull down the HID branch but Iā€™m not quite sure how to use it

@harrisonhjones, sure thing.
Iā€™ve only been testing the keyboard feature very briefly. I mainly focused on the mouse capabilities, so I only have a ā€œcloud mouseā€ application.cpp.
But once you figured out how this one works the keyboard thingy will be a piece of cake :wink:

You can download my application.cpp from my Dropbox

Iā€™ve also written a C# program to control this ā€œcloud mouseā€ from my tablet - the cloud lags a bit, but itā€™s fun :smile:

Edit: One thing I forgot to mention. In main.h you need to alter this

//#define SPARK_USB_SERIAL
#define SPARK_USB_MOUSE
//#define SPARK_USB_KEYBOARD

Since we are at reviving things ;-):
Iā€™d still like to see the Core to be able to act as a composite device (Mouse AND Keyboard AND Serial (AND MassStorageDevice if possible) AND ā€¦) - at the moment itā€™s only exclusive OR.
Also an ā€œAbsolute Mouseā€ (like digitizer tablet) would be useful.

Maybe others could aswell vote for this enhancement there


and/or

1 Like

If we could get even rudimentary massstoragedevice to work I would be so happy. We could configure the damn wifi settings using it! Think of how easy it would be to setup the device! No more serial terminals!!!

1 Like

Iā€™m new to Particle but have been involved in programming with Ardunio and Teensy. Re absolute Mouse.MoveTo(), Teensy has implemented this ā€˜out of the boxā€™ meaning, if you are using a Teensy, then you have this feature, no includes or libraries to pull in.

Ardunio on the other hand, does NOT have absolute mouse move (it has relative mouse move) and they are not sure how to implement it IF they were going to add it. I get the feeling from reading their replies that they donā€™t have much interest in adding this feature.

The point of all of this is: Mouse.MoveTo() CAN be implemented (by that I mean it is possible, not impossible) because the Teensy folks have done it. Again, I am new around here and donā€™t know the major players/developers or how new things get done, but if Particle were to implement it as a new feature, you folks would be ahead of the Ardunio camp in that respect.

BTW the BIGGEST (by far) feature Particle has over BOTH Ardunio and Teensy is your remote flashing capability. This community (Ardunio, Teensy) primarily thinks in terms of using their boards for home projects, local projects. They donā€™t have a mind set about deploying code ā€˜into the fieldā€™ and then having to support it with updates. For those who are building projects to sell and need an easy way to update their code after deployment, Particle is THE solution.

1 Like