MacOS – Cannot cmd-click or option-click code in Xcode and other applications with non-Apple keyboard

keyboardmacbook promacosshortcutxcode

I have recently acquired a mechanical keyboard Corsair K70 (non RGB model) and have successfully used it with macOS Sierra (10.12.6). Everything works as expected with the exception of certain keyboard shortcuts within Xcode. One of which is Cmd + Left Click on a function name, which brings up an action popup menu as shown in the image below:

popup menu example.

The same goes for the function documentation Option + Left Click:

function documentation

The shortcuts work as expected when using the built in keyboard on the MacBook Pro (15-inch, 2017), but they do not work when using the externally connected (usb) keyboard. The layout is English ISO/European as shown in the image below:

keyboard layout

When trying the shortcuts on the mechanical keyboard, it feels as if the UI is glitchy and not fully processing the shortcut.

Best Answer

I finally found the solution to the problem. Basically when using the external keyboard, I installed a tool called CKB which helps with re-mapping keys. I originally believed this was required. However, from macOS Sierra and above this remapping of modifier keys like Ctrl,Cmd and Shift is now available in the System Preferences under Keyboard > Modifier Keys.

So the solution was to uninstall CKB reboot and set the custom mapping in the System Preferences

For more info I've included the link where I found the answer: https://github.com/ccMSC/ckb/issues/473