On Mon, 15 Mar 2021 21:40:55 GMT, Martin Fox <github.com+12087024+belden...@openjdk.org> wrote:
>> https://github.com/openjdk/jdk/blob/8760688d213865eaf1bd675056eb809cdae67048/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m#L462 > > On the French keyboard the digits are shifted but I assumed we would still > want those keys to map to KeyCode.0-9 as they do on Windows. My solution was > to hard-code those key positions to be digits but this interferes with Dvorak > layouts. I'm tweaking the implementation to fix this. The new approach will > be to query both the shifted and unshifted characters on a key and favor > digits and letters over everything else (and something over nothing). > > (I've been writing Mac code to enumerate all the OS keyboard layouts and > generate lists showing which Java key codes will change from the historic > implementation. It also does some sanity checking.) Maybe this is a very dumb idea but why are we not using the char to map back to the keycode? At least for everything in the ASCII-Range this would be ok not? We'd only have to check for special keys (like NUM-Keys, F-Keys, ...) first. So once we checked and the text is of length 1 we could do the mapping from the char. ------------- PR: https://git.openjdk.java.net/jfx/pull/425