Basic USB HID test failing...
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Basic USB HID test failing...
I'm a big supporter of user wikis. Alas much the content of ours is out of date and has been superseded by official documentation - it does look sad and unloved. I still think it's a good place to post links to user contributed code - easier to find than trawling the forum. I once offered to tidy it up but was discouraged - I think the plan is eventually to move it to another platform.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Basic USB HID test failing...
Thanks for the confirmation, it wasn't just a false impression then
I think I'll still put up in there a summary of what I have working, thanks to the contributions of everybody in this thread, and then see if someone is willing to port it to the official docs (next to the HID mouse example seems like the logical place).
I think I'll still put up in there a summary of what I have working, thanks to the contributions of everybody in this thread, and then see if someone is willing to port it to the official docs (next to the HID mouse example seems like the logical place).
Re: Basic USB HID test failing...
I finally got to spend some time on documenting our adventures here on the Wiki :
http://wiki.micropython.org/USB-HID-Key ... ord-dongle
Feedback is always welcome.
If anyone feels like moving this inside the official documentation (alongside the HID mouse example maybe), feel free
Thanks to all,
fp
http://wiki.micropython.org/USB-HID-Key ... ord-dongle
Feedback is always welcome.
If anyone feels like moving this inside the official documentation (alongside the HID mouse example maybe), feel free
Thanks to all,
fp
Re: Basic USB HID test failing...
def sendchr(char) :
if not char in kbfr.keys() : # print warning to REPL if active
print("\nUnknow char\n") ; return
# key down with modifiers
buf[2], buf[0] = kbfr[char]
kb.send(buf)
pyb.delay(10)
# key up
buf[2], buf[0] = 0x00, 0x00
kb.send(buf)
pyb.delay(10)
hello, first of all let me thank you for all your work and research on the subject, i have just one question:
why do i get a error that says that kbfr is not defined...did you define it in the kb_map.py file?
Cheers,
if not char in kbfr.keys() : # print warning to REPL if active
print("\nUnknow char\n") ; return
# key down with modifiers
buf[2], buf[0] = kbfr[char]
kb.send(buf)
pyb.delay(10)
# key up
buf[2], buf[0] = 0x00, 0x00
kb.send(buf)
pyb.delay(10)
hello, first of all let me thank you for all your work and research on the subject, i have just one question:
why do i get a error that says that kbfr is not defined...did you define it in the kb_map.py file?
Cheers,
Re: Basic USB HID test failing...
Ah, well spotted, sorry for the confusion !
Yes, that dict used in sendchr is the one defined in kb_map.py, so the same name should be used.
What happened is that I use an AZERTY layout, so in the original code it was called kbdfr everywhere...
For the Wiki entry I changed it to kbmap to make it more generic... and of course I managed to miss that one occurrence
Yes, that dict used in sendchr is the one defined in kb_map.py, so the same name should be used.
What happened is that I use an AZERTY layout, so in the original code it was called kbdfr everywhere...
For the Wiki entry I changed it to kbmap to make it more generic... and of course I managed to miss that one occurrence
Re: Basic USB HID test failing...
[quote="fpp"]Ah, well spotted, sorry for the confusion !
Yes, that dict used in [b]sendchr[/b] is the one defined in [b]kb_map.py[/b], so the same name should be used.
What happened is that I use an AZERTY layout, so in the original code it was called [b]kbdfr[/b] everywhere...
For the Wiki entry I changed it to [b]kbmap [/b]to make it more generic... and of course I managed to miss that one occurrence [/quote]
oh, ok, made the adjustments. Thanks
Yes, that dict used in [b]sendchr[/b] is the one defined in [b]kb_map.py[/b], so the same name should be used.
What happened is that I use an AZERTY layout, so in the original code it was called [b]kbdfr[/b] everywhere...
For the Wiki entry I changed it to [b]kbmap [/b]to make it more generic... and of course I managed to miss that one occurrence [/quote]
oh, ok, made the adjustments. Thanks