I did some reasearch based on https://github.com/tomaka/winit/issues/263 using a simple macOS app that just logs keyDown events. With my layout(based on Swedish Pro) ^, 篓, ~ don't work correctly since they are dead keys. Handling dead keys involves quite a bit more work that needs to be done in winit. I'm curious if handling dead keys is considered in scope for winit or if that's something that you expect applications themselves to deal with.
For comparison, the wayland platforms automatically handles dead keys. By that I mean that for example:
^ key (which is a dead key on my azerty keyboard)KeyPressed event for key ^ but no ReceivedCharacter evente keyKeyPressed event for key e, then a ReceivedCharacted('锚')So we have a discrepancy between backends, time to decide what to converge to.
What @vberger described is what should happen IMO. That's also currently the behaviour on Windows.
Might want to have a look at https://stackoverflow.com/questions/40088837/cocoa-objective-c-on-macos-handle-accented-characters-via-keydown?rq=1
Most helpful comment
What @vberger described is what should happen IMO. That's also currently the behaviour on Windows.