Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift Select or Cmd Select not Working on macOS Sierra #29

Closed
smachi opened this issue Jan 17, 2017 · 59 comments
Closed

Shift Select or Cmd Select not Working on macOS Sierra #29

smachi opened this issue Jan 17, 2017 · 59 comments

Comments

@smachi
Copy link

smachi commented Jan 17, 2017

This issue comes from the original CKB driver but still present on this fork:

ccMSC/ckb#534

@philmb3487
Copy link

bump pressing issue

@tatokis tatokis added the bug label Jan 18, 2017
@rag3trey
Copy link

rag3trey commented Jan 19, 2017

I would also like this bug fixed. from the looks of it, only Corsair brand mice are synergizing well with the Corsair keyboard. So, until this bug is fixed I am having to use my Corsair Scimitar instead of my preference: Razer DeathAdder Chroma.

@frickler24
Copy link
Collaborator

sorry that I cannot help on this issue. I don't have mac and on linux your scenario is running normally.

@philmb3487
Copy link

It works with corsair mice?
Would like to confirm, I'll think about picking one up in that case.

@dtrang
Copy link

dtrang commented Jan 21, 2017

I am having this problem too running macOS Sierra. As an avid IntelliJ and Chrome user not being able to use Cmd + Click or Shift Click bugs the hell out of me. The reasons for me to buy this keyboard were:

  • To test drive the Cherry MX Speed switch: it felt a bit weird at first since I've been using my Das 4 Ultimate Cherry Brown for the past few years. It took a few hours to get used to but now everything is honky dory and I actually enjoy using this keyboard. The build quality is indisputable.
  • For my kid to play with the color effects! They absolutely loves them so it actually worths the trade-off of not having Cmd + Click working properly. A big big thank you to all the awesome people that made 'ckb' and 'ckb-next' (I had to build ckb-next for my K70 Rapidfire RGB since I couldn't find the binary build).

However my kid only plays with this for maybe 15' max every day and I need to do some side projects at home for 2+ hours everyday on even more hours on the weekend! So again having Cmd + Click while retaining all the animated color effect is a must for me. I think I just found out a work around for the best of both requirements.

  • Enable the driver when my kid wants to play: sudo launchctl load -w /Library/LaunchDaemons/com.ckb.daemon.plist
  • Disable the driver when I need to work: sudo launchctl unload /Library/LaunchDaemons/com.ckb.daemon.plist. All the modifier keys are back to work normally.

I've tested this a few times and it's worked perfectly without having to restart my Mac.

Btw for those who want a quick instruction to build ckb-next from command line, this is what I did:

  • Ensure you have Xcode and Xcode CLI tools installed
  • Get brew
  • Install qt5 from brew: brew install qt5
  • Run ./quickinstall from ckb-next
  • Choose Yes to install ckb system wide and driver system wide

@AlexanderXu2008
Copy link

I have the same issue with K65 RGB && Sierra
I don't konw how to fix it.
It will go bad with load /Library/LaunchDaemons/com.ckb.daemon.plist ,If I load this file ,my k65 can not use cmd and shift to select muti files well. That's so ......strange..
Please tell me What should I do ?

@robertlestak
Copy link

robertlestak commented Jan 22, 2017

Have been watching this issue as I am experiencing the same bug (as well as the "hit caps lock too many times and everything crashes" bug). However this morning, it appears to have gotten worse - previously, I could not use the modifier hold key combos (shift/cmd + select, cmd multi-line in Atom, etc.) but could still use them for basic modifier functions (cmd + a, cmd + w, cmd + n, etc). Now, the modifier keys don't have any effect at all.

EDIT: Just did some testing - I can rebind the command function to any other key, however any binding I set for the Windows/Cmd key is ignored.

@mattanger
Copy link
Owner

Just to make everyone aware, Sierra support is, at best, very poor. We're working on a solution, but Apple deprecated APIs used by ckb-next in Sierra and we have not found a good solution yet. This post: http://dae.me/blog/2144/on-macos-sierra-support-and-the-future-of-smoothmouse/ has some relevant information regarding some of these issues.

MacOS hackers/experts/wizards are invited to contribute. Those of use who are working on this project currently are not MacOS experts.

@fleischie
Copy link
Collaborator

I just tested my K70 RGB out on the latest master version. I bound the keys in the following way:

  • Ctrl -> Control
  • Windows -> Option
  • Alt -> Command

In the terminal it works as expected, a non-corsair and a corsair-but-non-ckb-trapped keyboard works the default way (ctrl -> control, windows -> command, alt -> option).
In the finder the shift/cmd + select does not work with the K70 but as expected with the non-corsair and corsair-but-not-ckb-trapped keyboard.

I researched a little and discovered, that we cannot naively replace the Carbon API with the Cocoa API, the former is the legacy C API, the latter is the newer Objective-C API. Thus, if we want to update the Daemon process, we need to split the source code into two OS-specific sources ... OR ... use a more high-level abstraction library of which I don't know yet, which. ... OR ... we remove the rebinding of the keys, which should be handled by other software (maybe the Karabiner-rewrite).

I personally am in favor of removing this, as it adds another level of maintaining- as well as OS-specific problems. If you have differing opinions/reasoning, I would like to hear it.

@ssvenn
Copy link

ssvenn commented Jan 28, 2017

If the modifier key remapping functionality is what breaks ctrl-clicking in Sierra I'm in favour of just stripping out that functionality too on the macOS platform. I think most people installing ckb are just interested in the RGB light effects anyway.

@philmb3487
Copy link

, we can remap the control and option keys in the settings already.
+1 to that

@fleischie
Copy link
Collaborator

After some more research I found out, that the problem with mac-specific keyboard drivers is more severe, that at first anticipated:

  • Carbon is the C Mac OS API and
  • Cocoa is an Objective-C Mac OS API.

This means, that for utilizing the Cocoa API, we have to write a separate daemon process to handle the keyboard functionality.

Apart from that, I will try to remove the Mac OS-specifc remapping-functionality for Sierra and above in a separate branch in the next few weeks. (Disclaimer: I say the next weeks, as I am not sure, how long I can work on this each day.)

@tatokis
Copy link
Collaborator

tatokis commented Jan 30, 2017 via email

@philmb3487
Copy link

I'm willing to work on this if someone points me in the right direction with what's needed.
AFAIK my keyboard is not affected by #31 (non RGB STRAFE), so we should keep this and not merge the issues together.

@fleischie
Copy link
Collaborator

fleischie commented Jan 30, 2017

@sinetek Yes please feel free to look into this issue. I discussed this further with @tatokis and @light2yellow in the IRC chat, you're welcome to chat with us there, as well.

My research so far:

The main problem it seems is that Mac OS is awaiting an explicit setting of the appropriate IO Option Bit/Flag, when using a command modifier (Cmd/Shift/Alt/Option/etc.). Thus your best bet is to check out input_mac.c.

More specifically, os_keypress is used to handle all queued keypresses, which calls postevent_kp, which also calls postevent. Somewhere here there must be checked, where the key event is generated and therefore correctly initialized with the appropriate keyboard option flags. (The most obvious ones should be NX_SHIFTMASK and NX_CONTROLMASK.)

Then I am puzzled as how to fix the additional selection functionality. Maybe also check Karabiner-Elements how they are implementing this (and whether this works as intended).

If you need further information and/or discussion, you can always ask or come into the IRC chat and chat with us. 😄

@daveedjackson
Copy link

My issue with this is fairly recent. Not had the issue before with the modifier and click. But can't use shift/control to highlight files, or layers in software like photoshop, after effects etc or system wide for that matter.

BTW i'm using a standard wired Apple keyboard. UK and US version - both have the same problem. Shift to rescale items (keeping proportions) anything requiring a shift/control shortcut no longer works. Wonder if anyone has any thoughts. There have been multiple updates but still present... Seems odd that this wouldn't be fixes as a matter of urgency?
Thanks in advance.
D

@ghost
Copy link

ghost commented Jan 30, 2017

@daveedjackson this is strange, Apple keyboard must work. The only issue related to a few keys was found and fixed in sierra .2. Do you use Karabiner? If yes, it is no longer suitable, use Karabiner-elements instead.

@daveedjackson
Copy link

@light2yellow Two keyboards don't - have literally tried everything - it's very annoying - and very strange. No i don't use Karabiner...

@ghost
Copy link

ghost commented Jan 30, 2017

@mattanger
Copy link
Owner

@daveedjackson Not that we don't want to help you out, but the issues in the this thread are related to corsair keyboards and ckb-next.

@fleischie
Copy link
Collaborator

Just for reference, I am currently trying to read the apple system's documentation:

The specified issue is referenced as Keyboard Interface Control, which - if I understand correctly - has something to do with how Apple's Windowing System handles keyboard input delegation.

The main problem still seems to be, how the daemon is handling the low-level usb-input-events and how Cocoa-based applications handle high-level framework specific input-events.

I am starting to get the feeling, that Apple is expecting the low-level functionality, which is happening in the daemon to be implemented in the high-level (Cocoa) portion of the app (which is used as the GUI as well as user input handling). I am contemplating a possibility to write the daemon separately as a C++ program, that is linked against the Cocoa framework, utilizing the "high-level" portion of the key-inputs. But I am still trying to figure out, how the daemon does and the Apple expects to work. 🤷

@sinetek are you still interested in this issue?

@philmb3487
Copy link

@fleischie Yes, I am, yes. I'll need to read the documentation first and get a handle on what you said.

@max-l-weaver
Copy link

Just FYI shift-select works fine when ckb-next is removed. Not sure if anyone has tried this yet? As nice as it is to have the RGB functionality of this keyboard, and as much as I appreciate everything the developers are doing, it's gonna have to remain uninstalled until this vital feature is repaired.

@clodal
Copy link

clodal commented Feb 7, 2017

Hi guys, could we label this issue with the macOs label and also include this as a known issue in the README for macOS users? This would be really helpful. Thanks!

@AlexanderXu2008
Copy link

After a period of use, I found that, once loaded the com.ckb.daemon.plist file, I can't use CMD and shift - select, even if I don't start CKB. App, if delete the com.ckb.daemon.plist files, my keyboard can use as normal, but the default configuration of lights I can use only.(K65 RGB LUX,MacOS 10.12)

fleischie added a commit that referenced this issue Feb 16, 2017
This was a recommendation of @clodal in #29.
@smachi
Copy link
Author

smachi commented Mar 27, 2017

@auibrian The output is:

total 480 drwxr-xr-x 9 root admin 306 19 mar 09:37 ckb-animations -rwxr-xr-x 1 root admin 212156 19 mar 09:37 ckb-daemon -rw-r--r-- 1 root admin 26827 19 mar 09:37 ckb-logo.icns -rw-r--r-- 1 root admin 0 19 mar 09:37 empty.lproj -rw-r--r-- 1 root admin 78 19 mar 09:37 qt.conf

And

root 128 2,3 0,1 2516660 9308 ?? Ss 8:28AM 0:39.95 /Applications/ckb.app/Contents/Resources/ckb-daemon Salva 4073 0,0 0,0 2442020 2060 s000 S+ 8:58AM 0:00.00 grep ckb-daemon

All the other CKB features (light, binding, etc) are working normally, just the cmd/shift + click is not working now

@auibrian
Copy link
Contributor

@smachi Thanks. Very odd. I'm running 10.12.2. Let me see what happens if I upgrade. I'll need a day or two to explore this fully.

@smachi
Copy link
Author

smachi commented Mar 27, 2017

@auibrian No problem. Thanks a lot for your help.

@ghost
Copy link

ghost commented Mar 27, 2017

@mrgaolei you can't find it because this is an issue, the PR itself is #106.

When you visit that page, on the top of it you will see something like

screenshot_20170327_120502

You are interested in the from part of it. For some reason GitHub doesn't allow easy navigation by click here, so here's what I would have done:

git clone https://github.com/auibrian/ckb-next.git --branch issue29 --single-branch aubrian-ckb-next
  • cd and build (like README suggests):
cd aubrian-ckb-next
./quickinstall

@SeNeO
Copy link

SeNeO commented Mar 27, 2017

I've got the same issue that @smachi and @juaganmu mentions. After each reboot of my iMac the modifier keys doesn't work anymore. I need to go to the activity monitor to kill the daemon, and after it restart the modifier keys works again.

@auibrian
Copy link
Contributor

I'm seeing something similar now that I've upgraded to 10.12.3 from 10.12.2. I will report back when I have found more.

@rag3trey
Copy link

rag3trey commented Mar 27, 2017

@auibrian it is seeming like there is some sort of modifier inside ckb-daemon causing it to revert. My iPad is about to die or I would go through the code and see if I could find it.

I may have to wait until I get home to see if I am having this same issue. (I admit. I have been bad... Been using my Blackwidow Chroma. The Strafe is much better quality for a keyboard though. I just needed the audio pass through. =( )

@auibrian
Copy link
Contributor

I think I've gotten this figured out. I'm hoping to have a fix w/in 24 hours. Thanks for the feedback everyone!

@mrgaolei
Copy link

@auibrian I have the same problem with @juaganmu @smachi
Shift + Click will failed when I restart computer.

@ghost ghost mentioned this issue Mar 29, 2017
@sam-gurdus sam-gurdus mentioned this issue Apr 1, 2017
Closed
@rag3trey
Copy link

rag3trey commented Apr 2, 2017

So, is there an update to the fix @auibrian ?

@rag3trey
Copy link

rag3trey commented Apr 2, 2017

@auibrian I seem to have discovered something on your PR. by running
sudo launchctl unload /Library/LaunchDaemons/com.ckb.daemon.plist
and then
sudo launchctl load /Library/LaunchDaemons/com.ckb.daemon.plist
the functionality comes back.
This is the only sort of temporary fix I can find at this time.

@auibrian
Copy link
Contributor

auibrian commented Apr 2, 2017

Hi @rag3trey,

Yes, I made a fix the other night for it but it's not ready to release yet. I'd like to explore another option. The short version of the issue is: when a user isn't logged on we can't create the CGEventTap. If you waited until after login to plugin your keyboard after a restart you would. Or see this problem. Also as you have discovered a simple restart of the daemon will also route around the problem for the time being. I'm hoping to finish my second version of the fix this weekend.

@rag3trey
Copy link

rag3trey commented Apr 2, 2017

ah good news @auibrian
Looking forward to it.

@rag3trey
Copy link

rag3trey commented Apr 2, 2017

also @auibrian shouldn't it not really matter if it doesn't work on the login screen? You aren't trying to shift click or anything there. It may just need to start it with the client, rather than with the computer itself.

The keyboard should work with just plug-and-play since it it just sort of... well.. a keyboard.

Correct me if I am wrong though.

@tatokis tatokis added this to the 0.2.7 release milestone Apr 3, 2017
fleischie added a commit that referenced this issue Apr 28, 2017
This merge closes PR #106 and thus issue #29.
@smachi
Copy link
Author

smachi commented Apr 28, 2017

Hi @auibrian,

Any news about the new fix you were working on?

@fleischie
Copy link
Collaborator

fleischie commented Apr 28, 2017

I closed the appropriate PR right now and the changes are in the testing branch.

Regarding the supplemental issue, please open a new separate issue. Thank you! 🙂

@Nelnamara
Copy link

Compiling from source works for me on High Sierra 10.13.2 The pre built binary is from May and from what I can surmise from comments does not implement the fix. I just did the quickinstall as I already had the other prereqs installed or setup already for my own coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests