On May 10, 2015, at 2:45 PM, Peter Maydell wrote: > On 15 January 2015 at 21:13, Programmingkid <programmingk...@gmail.com> wrote: >> Fixes keyboard mapping so right shift, right command, right option, right >> control, keypad period, keypad '=', keypad enter, and F13 all work. >> >> Signed-off-by: John Arbuckle <programmingk...@gmail.com> >> >> --- >> Undid most changes to keyboard map in cocoa.m. >> Most changes made to keyboard map in adb.c. >> Since there is no keypad '=' key for the PC/AT or PC/XT layouts, I had to >> invent my own number for it. It works for the Mac OS X guest. Guest like >> Windows XP are not effected because they don't use the Macintosh keyboard >> layout. >> >> Signed-off-by: John Arbuckle <programmingk...@gmail.com> >> >> --- >> hw/input/adb.c | 8 ++++---- >> ui/cocoa.m | 4 ++-- > > This is two conceptually separate fixes: > (1) better handle key input to the ADB keyboard > (2) output the right keycodes on the OSX cocoa UI > which should be in separate patches. > > We should also be doing the support for keypad-= by converting both > the cocoa UI and the ADB keyboard device to the QKeyCode APIs, > which can cleanly handle these key without inventing fake PC > keycode numbers, as suggested by Gerd: > https://lists.gnu.org/archive/html/qemu-devel/2015-02/msg01322.html
So what you want is to eliminate the ps/xt key mappings found in the cocoa.m and use the QKeyCode API? I really didn't like how in the cocoa.m file, a key press is first translated to a ps/xt key value, then translated to a Macintosh ADB keycode. Basically this: Macintosh host key code => PS/XT key code => ADB key code I do admit I'm not fully sure how the new API is suppose to work. For a Macintosh host and guest it probably should work like this: Macintosh host key code => sent directly to guest OS For a Macintosh host and a PC guest, it probably should work like this: Macintosh host key code => PS/2 key code (not PS/XT) For a PC host and a PC guest, it probably should work like this: PC host key code => sent directly to guest OS For a PC host and a Macintosh guest, it might work like this: PC host key code (PS/2) => ADB key code The above shouldn't be hard to do. Code would need to be added to the cocoa.m file to detect the currently used emulator. Host key code => QKeyCode => guest key code I would like to avoid this translation because it would be relatively slow. It would be as inefficient as what we have now. > My apologies for this review being so delayed; I'm now > trying to process my queue of OSX to-review patches. Five months is a long time, but it is way better than never.