F13-F24 HID keys

Posted on
  • Has anyone gotten F13-F24 keys to be sent from a Puck? I've tried to send them as HID commands using their numerical ID but applications that can/should recognize them don't for some reason.

    I can confirm the application can recognize F keys beyond 12 by using AutoHotKey to send the key.

  • It might be related to the 'HID report'? The array at the top of http://www.espruino.com/modules/ble_hid_­keyboard.js

    If you could find the HID report for a keyboard that has those extra keys then we could use that (or at least see how it differs from the one we currently send)...

  • Hm. The PDF included in the HID library saya F13+ are included in the 0x07 page, which is the same page already included for basic keys. I'll see if I can find more info the HID report descriptor.

  • Sorry for the double post but found someone encountering a similar issue with another kind of custom HID, the same fix may apply here. I'll see if I can test by making the change locally and importing that


  • Great! That sounds a lot like it'd be the issue. You could just copy the contents of http://www.espruino.com/modules/ble_hid_­keyboard.js into the IDE for now to test with.

    edit: This bit is I think the one that wants changing: https://github.com/espruino/EspruinoDocs­/blob/master/modules/ble_hid_keyboard.js­#L38-L45

  • Looks like that works. Changed lines 41 and 44 to 0x73 and I was able to send F13 as a key.

  • Great - thanks for checking it out! I've just made the changes so next time I update the main site it'll go live

  • Do you think it'd make sense to throw F13-F24 into the KEY array? Just so people know they have the option. I've found them to be a great alternative to using keys that may conflict with other applications. Most keyboards don't have F13+ keys anyways.

  • I was wondering about that - the problem is that adds a reasonable amount more memory usage for everyone using the HID keyboard class. I guess F13-24 all have adjacent numbers? If so maybe we could just add F13 as a key and then a comment in the file? Writing F13+1 isn't too painful?

    Although having said that there's loads of stuff in there already - a bit more wouldn't make much difference!

  • Hey - I saw this was updated on the site, but it's not working when uploading the code via the IDE. Is this file cached or something, so it's not being pulled fresh everytime?

  • Mon 2018.08.20

    @tako, the post entry needs clarification.

    ' I saw this was updated on the site'

    What was meant by 'this' was updated, the forum posting system or something on the main web site?

    'but it's not working when uploading'

    Ref 'it's' What is not working, the IDE app itself or the code that was uploaded using the IDE?

    'Is this file cached or something'

    What file are you referring to? The code file you are uploading to the Espruino device via the IDE?

    Is this related to the 'black screen' you reference in another separate post:
    Espruino Native IDE doesn't launch properly

  • Gordon updated the Bluetooth HID javascript file per the conversation earlier in this post.

    When uploading code to the Puck.js using the IDE, and trying to send a F13-F24 key, the expected key is not sent. The same behavior as before the modification. Nothing to do with the other post.

  • To assist @Gordon with more detail, have you gone back and verified using the file copy and insert that you did above, AND does that way work and just the repository change version does not? What is different between the two code blocks? Are there remnants of the old copy-insert remaining in the new code block version?

    From #6: 'Looks like that works. Changed lines 41 and 44 to 0x73 and I was able to send F13 as a key.'

    'When uploading code to the Puck.js using the IDE, and trying to send a F13-F24 key'

    Would you be so kind as to include the line of code that references the module and the line of code that sends the F13 key please. The entire code block would be preferred.

    Are you using the native app IDE, the Chrome store Web IDE or the online Web IDE link?

    What is the URL inside the IDE:

    Settings >> Communications >> Module URL

  • The URL in the desktop IDE (which is what I use 99% of the time) points to: https://www.espruino.com/modules/

    I'll re-check the manual code changes tomorrow, but they definitely worked when I tested them. I'm thinking the IDE does a level of caching?

  • The IDE & website tries pretty hard not to do caching for modules so they can be updated pretty easily.

    If you don't have the module URL tweaked, do you have Offline mode turned on? That could do it.

  • Interestingly enough, I tested again just now and it's working! Weird.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

F13-F24 HID keys

Posted by Avatar for tako @tako