diff options
author | Ben Byer <bbyer@bbyer.apple.com> | 2007-11-05 20:01:34 -0800 |
---|---|---|
committer | Ben Byer <bbyer@bbyer.apple.com> | 2007-11-08 20:04:44 -0800 |
commit | 67e96be13cdb45be31db121ce216295cd9496d20 (patch) | |
tree | 8c9e46d28b8f2b946b5da989aad30c3e7529b01d /hw | |
parent | 154fb6417e5d0bae5191984beac5ce045ce754bb (diff) |
Fixed logic error that prevent JIS (Japanese) keyboard layouts from
being detected.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/darwin/quartz/quartzKeyboard.c | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c index b580a8e84..40b5e92f7 100644 --- a/hw/darwin/quartz/quartzKeyboard.c +++ b/hw/darwin/quartz/quartzKeyboard.c @@ -222,36 +222,27 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info) KeySym *k; TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource(); - if (currentKeyLayoutRef) - { - CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); - if (currentKeyLayoutDataRef) - chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); - } - - if(chr_data == NULL) { - KLGetCurrentKeyboardLayout (&key_layout); - KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); - - if (chr_data != NULL) - { - is_uchr = 1; - keyboard_type = LMGetKbdType (); - } - else - { - KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); - - if (chr_data == NULL) - { - ErrorF ( "Couldn't get uchr or kchr resource\n"); - return FALSE; - } - - is_uchr = 0; - num_keycodes = 128; - } - } + keyboard_type = LMGetKbdType (); + if (currentKeyLayoutRef) { + CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); + if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); + } + + if (chr_data == NULL) { + KLGetCurrentKeyboardLayout (&key_layout); + KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data); + } + + if (chr_data == NULL) { + KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data); + is_uchr = 0; + num_keycodes = 128; + } + + if (chr_data == NULL) { + ErrorF ( "Couldn't get uchr or kchr resource\n"); + return FALSE; + } /* Scan the keycode range for the Unicode character that each key produces in the four shift states. Then convert that to |