HID Keyboard functionality?
HID Keyboard functionality?
Hi all,
I've seen (and played around) with the HID mouse emulation in the pyb class, which is awesome!
However, I' was wondering if there is (or will be) any keyboard-emulation support? I've got some nifty ideas if that's possible.
Cheers,
Alex.
I've seen (and played around) with the HID mouse emulation in the pyb class, which is awesome!
However, I' was wondering if there is (or will be) any keyboard-emulation support? I've got some nifty ideas if that's possible.
Cheers,
Alex.
-
- Posts: 14
- Joined: Wed May 07, 2014 7:32 pm
- Location: Norway
Re: HID Keyboard functionality?
Have not tested any of the hid yet, but I got the urge as well for keyboard emulating.
Re: HID Keyboard functionality?
I second that. It'd be great for those numerous keyboard emulation projects =)
Re: HID Keyboard functionality?
Hi,
count me in, in fact you might want to read my rants about a DIY keyboard based on micropython
http://forum.micropython.org/viewtopic.php?f=5&t=284
I didn't find time to check into detail, but it shouldn't be to difficult to get something working taken that HID/mouse is there already
count me in, in fact you might want to read my rants about a DIY keyboard based on micropython
http://forum.micropython.org/viewtopic.php?f=5&t=284
I didn't find time to check into detail, but it shouldn't be to difficult to get something working taken that HID/mouse is there already
Re: HID Keyboard functionality?
Is anyone working on this yet? I dont want to do duplicate work if possible. I'll strt and if I do get anywhere I'll post some code or work out how to submit to git.
Re: HID Keyboard functionality?
Ive got plenty to learn before I get this right. This is way more difficult than I originally thought.
Re: HID Keyboard functionality?
There have been a few requests now for extended HID functionality, so I'll start to look into it.
The idea would be that on boot up you specify "custom HID" and pass the HID descriptor, eg:
Of course, the descr set of bytes will need to define a valid HID device, such as a keyboard or mouse.
The idea would be that on boot up you specify "custom HID" and pass the HID descriptor, eg:
Code: Select all
descr = b"\x01\x02\x03..."
pyb.usb_mode('HID', descr)
Re: HID Keyboard functionality?
I have made a pull request for custom HID functionality, including keyboard and mouse:
https://github.com/micropython/micropython/pull/955
https://github.com/micropython/micropython/pull/955
-
- Posts: 1
- Joined: Thu Mar 19, 2015 6:13 pm
Re: HID Keyboard functionality?
Is this part of the base image now? I just got a pyboard and my boot.py still shows the old format
import pyb
#pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('CDC+MSC') # act as a serial and a storage device
#pyb.usb_mode('CDC+HID') # act as a serial device and a mouse
If not a standard part of the pyboard image, how would I go about adding it. I need a keyboard functionality for a project I'm working on.
Thanks
import pyb
#pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('CDC+MSC') # act as a serial and a storage device
#pyb.usb_mode('CDC+HID') # act as a serial device and a mouse
If not a standard part of the pyboard image, how would I go about adding it. I need a keyboard functionality for a project I'm working on.
Thanks
Re: HID Keyboard functionality?
It's part of the main image but no boards have yet shipped with this image because it still requires some final testing.philba2849 wrote:Is this part of the base image now? I just got a pyboard and my boot.py still shows the old format
You can download the latest version from https://micropython.org/download/, anything later than v1.3.10 from 13th Feb 2015, eg pybv10-2015-03-20-v1.3.10-227-g3425431.dfu will have it enabled. Links on that page tell you how to program the new image; also search on this forum for "dfu" if you get stuck.
The boot.py can remain the same to get the old USB+MSC behaviour. New behaviour is not well documented, but see https://github.com/micropython/micropython/pull/955.