pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.59k stars 835 forks source link

JIS external keyboard recognized as US (ASCII) keyboard after v0.90.47 #278

Closed shao1555 closed 7 years ago

shao1555 commented 7 years ago

connect RealForce Compact JIS keyboard (details below), but recognized as US (ASCII) keyboard. after quit Karabiner Elements, works well.

trials

environments

do-gugan commented 7 years ago

It also happens on MacBook 12" + Sierra Internal JIS keyboard. Reinstall and restarting did not resolve the problem. I try old version. Thanks.

HIRANO-Satoshi commented 7 years ago

Takezo-san, thanks for a good software.

I have the same issue with 0.90.48 and RealForce.

I got the following error during build of 0.90.48. I cannot move to 0.90.46.

https://github.com/tekezo/Karabiner-Elements/issues/284

shao1555 commented 7 years ago

@HIRANO-Satoshi

you can download previous pre-built binary from here. https://pqrs.org/osx/karabiner/files/Karabiner-Elements-0.90.46.dmg

enjoy :-)

HIRANO-Satoshi commented 7 years ago

That's what I needed. It seems working.

Thanks so much, @shao1555.

@tekezo, thanks again for a great tool.

Making a small donation made me happy. Everyone, how about you?

https://pqrs.org/osx/karabiner/donation.html.en

do-gugan commented 7 years ago

I downgraded to 0.90.46, and once it seems work. but a few days after, it happened again (without upgrading newer version). I tried uninstalliing and deleting setting file, but no success. 0.90.50 also does not solve the problem.

305 and may be #311 are duplicate?

sylph01 commented 7 years ago

I think I got the same issue as @do-gugan 's with 0.90.46 ...

dcato commented 7 years ago

Hi all,

I experienced same symptom on macOS Sierra, Mac Pro 2009, HHKB pro type S (JIS). In my case, I cannot remember exact version number though, it occurs regardless of the Karabiner-Elements's version including current version. So, I guess that some state of MacOS may be related to this problem, such as external keyboard connected or not at boot time or you have connected an ASCII keyboard or not and so on.

Anyway, I looked at Karabiner-Element and Karabiner's source code, and I managed to avoid this problem in a very ugly manner. If you don't mind it, try this! I believe this is almost equivalent to Karabiner's __SetKeyboardType__ KeyboardType::JIS_MACBOOK_2008.

  1. Apply attached patch to Karabiner-Element's source tree.
  2. make
  3. Overwrite karabiner_event_dispatcher with newly compiled one.
    • sudo cp BUILD_ROOT/Karabiner-Elements/pkgroot/Library/Application\ Support/org.pqrs/Karabiner-Elements/bin/karabiner_event_dispatcher /Library/Application Support/org.pqrs/Karabiner-Elements/bin
  4. Kill karabiner_event_dispatcher process. (Karabiner automatically reboot it)
    • Quit Karabiner and restart it is not enough. It looks karabiner_event_dispatcher is still running after quit Karabiner.

patch.txt

Thank you,

HIRANO-Satoshi commented 7 years ago

@dato, I tried and it is working. Thanks much.

As you instructed, I changed src/share/hid_system_client.hpp like this, and run make, then installed the newly generated app. It is working without doing step 3 and step 4 in your list.

  void post_key(uint8_t key_code, krbn::event_type event_type, IOOptionBits flags, bool repeat) {
    NXEventData event{};
    event.key.origCharCode = 0;
    event.key.repeat = repeat;
    event.key.charSet = NX_ASCIISET;
    event.key.charCode = 0;
    event.key.keyCode = key_code;
    event.key.origCharSet = NX_ASCIISET;
    // event.key.keyboardType = 0
    event.key.keyboardType = 42; // JIS_PC_USB_KEYBOARD

I chose 42 for my PC keyboard from a list of keyboard types.

tekezo commented 7 years ago

Please upgrade Karabiner-Elements to the latest version and set keyboard type in Devices tab. https://github.com/tekezo/Karabiner-Elements/tree/master/usage#set-keyboard-type

shao1555 commented 7 years ago

thank you so much!

HIRANO-Satoshi commented 7 years ago

It' working for me, too. Thank you!

etdev commented 7 years ago

Thanks! All the keys work now, but FYI Karabiner-EventViewer is showing the wrong (US) keys.

mono0926 commented 7 years ago

Thanks, I wrote an article about it: macOS SierraでWindowsキーボードがようやく問題無く使えるようになりました🎉 – ガジェットポエム – Medium

axot commented 5 years ago

I also suffered this issue in the latest version(12.1.0), any advice?