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

Add Ctrl + Left click karabiner rule #7

Closed
raxigan opened this issue Feb 17, 2024 · 1 comment
Closed

Add Ctrl + Left click karabiner rule #7

raxigan opened this issue Feb 17, 2024 · 1 comment

Comments

@raxigan
Copy link
Owner

raxigan commented Feb 17, 2024

raxigan added a commit that referenced this issue Jun 22, 2024
raxigan added a commit that referenced this issue Jun 22, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
raxigan added a commit that referenced this issue Jun 23, 2024
@raxigan
Copy link
Owner Author

raxigan commented Jun 23, 2024

For my future self:

There were 3 ideas how to achieve this:

  1. Basically remap all Ctrl + LMB clicks to Command + LMB (actually to Opt + LBM because I'm remapping this)

The algorithm:

  • set var x to true if Ctrl is pressed/held - most likely alone if possible

  • on pressing LMB first press Opt, then click - only if x == true

  • start pressing Opt, not once

  • set var y = true

  • do nothing if y == true

  • if Ctrl is released, then set x = false and y = false

  • this would be probably done in few separated rules, possibly separated between JetBrains tools and anything else

  • no-go because Karabiner-Elements does not support Apple tracking devices so I cannot remap touchpad clicks :/ - so I would end up with rule only working on my mouse, but not on laptop - makes no sense

  1. Whenever I hold Ctrl just remap it to Cmd/Opt
  • nothing is checked here in terms of mouse, so has some serious impact on ALL Ctrl-based rules
  • what does "hold" here even mean? Actually nothing, because I'd like to make it work even if LMB is clicked immediately after Ctrl
  • I also want it to work without ANY practical impact on other remappings, quite challenging and also not sure if actually possible
  • I'd use Karabiner's "to_if_held_down" here - the hold param is configurable, but as I've said it impacts all Ctrl-based rule, so for example if you hold Ctrl for 2 sec then press C - I should be still able to copy the item
  • for all my non-Jetbrains mappings it's fixable (not 100% sure here, there would be plenty of checks here to be made)
  • it impacts IJ keymap - I was kinda able to fix it, unfortunately IJ does not have this shortcut entry in they're keymap, so I could have only non-IJ rule - it would simplify things a lot

Summary:

  • very complex solution, tons of new rules, I've barely made it work and already seen many issues and potential risks
  • impacts not only my rules, but also users' custom rules if there are any
  • rules order may matter here
  1. Just swap Ctrl and Cmd on system level and rewrite all the configs
  • a lot of work, but seems to be 100% reliable
  • can be done via terminal
  • also fixes multicursor thing in IJ - rather nope
  • works immediately, but I have to swap the keys on Karabiner virtual KB in preferences
    - maybe try to restart OS and check what will be the keyboard item in the dropdown in Preferences

@raxigan raxigan closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant