Skycoder42 / QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
BSD 3-Clause "New" or "Revised" License
548 stars 161 forks source link

Get native keycode failed in mac #48

Closed DualThrust closed 2 years ago

DualThrust commented 3 years ago

function nativeKeycode in qhotkey_mac.cpp will return 0 when I was using Chinese input method. I think it is same when using Japanese or Korean input method.

line 137 should use TISCopyCurrentASCIICapableKeyboardLayoutInputSource instead of TISCopyCurrentKeyboardInputSource. I guess Chinese input method don't have a layout.

reference: https://jongampark.wordpress.com/2015/07/17/when-tisgetinputsourceproperty-ktispropertyunicodekeylayoutdata-returns-null/

Shatur commented 3 years ago

Hi! I do not have a Mac, but could you test it with the suggested change?

DualThrust commented 2 years ago

sorry to reply too late... everything work fine with Qt5 and Qt6 in mac

Shatur commented 2 years ago

Please, submit a PR then.

DualThrust commented 2 years ago

I have submit a PR to fix this.

RP: #66