iPadOS Magic Keyboard captures hotkeys prior to input field *Possible Bug?

Similar thread that I tried to follow: Make Space Bar NOT flip card immediately

On Anki Desktop pressing space, e, d, or other “hotkeys” doesn’t actually trigger the hotkey if the focused element is contentEditable: true. This is just as the thread above had mentioned the behavior would work. This, however, doesn’t hold true specifically for iPadOS. iOS on the other hand, works perfectly like the desktop.

i.e. lets take example of space bar.
Let’s say I am typing in a content editable field and I press spacebar:

on Anki Desktop with physical keyboard: a space is inserted inside field.
on iOS Ankimobile using virtual “on screen” keyboard: a space is inserted inside field just like Desktop.
on iPadOS Ankimobile using virtual “on screen” keyboard: a space is inserted inside field just like Desktop.

on iPadOS Ankimobile using apple brand physical keyboard: the space bar is interpreted as the hotkey for “Good” and it progresses to next card.

My best guess: iOS has a virtual keyboard on the screen whereas for iPadOS the keyboard is a physical keyboard and is captured by the app prior to capture by template? Is this true or can key press be captured by template before the app captures for hotkey?

I don’t have a solution but I know that in theory it should be possible to capture the hotkey, and in theory just as on any other device: if you were typing some text in an input widget, for instance, and pressed the space bar, it should insert a space, not flip the card. The contentEditable trick tries to exploit this.

1 Like

Yeah and the trick works everywhere except with physical keyboard on iPadOS. But even without trying to capture the event, I cannot type spaces in regular editable fields either.

I actually just recently found the following additional similar threads, and one guy seemed to have exact same problem but then said his problem went away?

Also, I wonder if this is somehow related (perhaps in fixing this bug the new bug was somehow introduced?):

Are you reporting an issue with the editing screen, or are you embedding a contentEditable inside your card content?

embedding a contentEditable inside my card template and then typing during review.

Please follow up on Keyboard not always shown when focusing HTML input/contenteditable elements on AnkiMobile

I’ve added this to the todo list to look into.

Awesome thanks! Does that mean you were able to replicate the issue?

Haven’t tried yet.

1 Like

Any chance you could look into this Damien? I would like to able to use physical keyboard to type in type able cards. On screen keyboard can lead to a lot of non type events being triggered. Currently typing with external keyboard only works in preview mode, but not during review.

This proved rather tricky to deal with, as iOS’s shortcut handling does not behave like the desktop web toolkit. I think I’ve found a solution; please let me know how you go when the next beta comes out.

Sounds good thanks!