[Question] What does brokenModifierNames mean? #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, I'm helping to debug an issue in Prosemirror (by way of TipTap) where the Swedish character
åis being reported as[(the former key on a Swedish keyboard shares the location of the latter on English keyboards)It looks like on Macs this is being misrepresented. From what I can tell, that's because
brokenModifierNamesis true when a Mac is being used which means the fallback ofevent.keyCodeis used. So I'm curious why that is, what are the cases where something is "broken" andevent.keyby itself can't be used while on a Mac.Tying in to that, because I haven't dug into the intricacies of all of this, across multiple languages or older browsers, I'm wondering what the use case is for this library over just using
event.keynaïvely? The README has no examples of where this would be useful to use, but it must be because you wrote and published a sleek little library for it :)Thanks for the help in understanding so I can sort out a good solution upstream!
On further researching, I see you work on Prosemirror and have fielded issues around this before. I can build up a proper sandbox and file an issue there if that's better (and I actually have a bug and not a misunderstanding/misuse). Cheers
On macOS, if you hold down Shift and Cmd,
event.keywill hold the base name of the key that was pressed, rather than the Shift-modified character. It used to be a bunch worse than that—it also behaved that way when Ctrl was held down, and would even reportkeynames for the physical keys instead of the chosen keyboard layout, but this issue prompted me to do some testing again and I found that most of this is fixed. I guess they have to keep the Cmd+Shift behavior for backwards compatibility. Attached patch narrows down the situations in which this hack (ignorekeyin favor ofkeyCode) is applied, which might address the issue you were seeing.