Toggle iOS on-screen keyboard with BLE HID Keyboard connnected - SOLVED! #6552
Replies: 1 comment
-
Posted at 2021-07-30 by @gfwilliams That's odd - You do have to send the 'keyup' event as well, so:
Might do it? However, in the 'HID Report' you have to give a 'logical maximum', which is the maximum keycode value you intend to send. In http://www.espruino.com/modules/ble_hid_keyboard.js you can see So if the above doesn't work, you could try copying the hid_keyboard code into your project, and changing Posted at 2021-07-30 by sammachin Hi Gordon, Sorry yes should have said I was doing the key up event as well just posted the keycode bit for clarity Thats a good point about the maxium I'll try that, do I need to raise both Logical Maxiumum and Usage Maximum ? Also I was confused about the vaule of the Keycodes are they Hex or Dec? the library seems to have hex for the modifiers and dec for the keycodes? are they just interchangable Posted at 2021-07-30 by sammachin no joy with sending it as a keycode or a modifier, built a little app that just steped through each code to see what would happen! With a little more digging it seems like the way to toggle it is to send I found this SO post https://stackoverflow.com/questions/22181883/bluetooth-le-hid-eject-key-code which looks like they're creating a second report object with the Application Launch buttons and then sending that for the toggle, but I couldn't figure out how to translate that into espruino to send the alternate report in NRF.sendHIDReport, is there a way to select the report ID? Posted at 2021-07-31 by sammachin SUCCESS! I've tested this on a pixl.js running 2.09 against an iPhone running iOs 14.6 so it works until Apple decide to change something!
Posted at 2021-08-02 by @gfwilliams That's awesome - thanks! And thanks for posting the code - are you ok with me sticking that on the BLE Keyboard page? Seems like it'd be pretty useful! Posted at 2021-08-02 by sammachin Sure, I updated the title to try and make it easier to find but putting it on the docs page seems like a good idea, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-07-30 by sammachin
I'm setting up a Puck to work with my iPhone as a BLE keyboard, all good so far but iOS has an annoying habit that it disables the on screen keyboard if there's a hardware one connected.
You can toggle the on-screen keyboard using the eject key on Apple Keyboards, which I belive is keycode 0x92.
I'd like to be able to send this from my puck so I don't have to keep disconnecting the keyboard in bluetooth each time.
Any ideas how to do this? I've tried
and
without any luck
Beta Was this translation helpful? Give feedback.
All reactions