Giter Site home page Giter Site logo

Comments (4)

iwill avatar iwill commented on September 23, 2024 1

@kzsh Thank you very much!

from ke-complex_modifications.

kzsh avatar kzsh commented on September 23, 2024

KE-complex-modifications does not yet have a config for this kind of behavior, but it can be done with a custom configuration of Karabiner-Elements. I've included a config below that would likely do what you want.

{
  "title": "Simulate \"hyper\" key",
  "rules": [
    {
      "manipulators": [
        {
          "description": "Change fn to \"hyper\" key (command+control+option+shift)",
          "from": {
            "key_code": "fn",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_shift",
              "modifiers": [
                "left_command",
                "left_control",
                "left_option"
              ]
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

One of the effects of something sweeping like this is that you wouldn't be able to trigger key combinations that require the fn key, since it would be overridden. If you still want to use the regular function key, you could create a more targeted config, that interprets the fn key as a hyper key only in combination with other specific keys that you need, e.g.:

{
  "title": "Change fn to \"hyper\" key (command+control+option+shift) with specific key combinations",
  "rules": [
    {
      "description": "Change fn + b to \"hyper\" + b",
      "from": {
        "key_code": "b",
        "modifiers": {
          "mandatory": [
            "fn"
          ],
          "optional": [
            "any"
          ]
        }
      },
      "to": [
        {
          "key_code": "b",
          "modifiers": [
            "left_shift",
            "left_command",
            "left_control",
            "left_option"
          ]
        }
      ],
      "type": "basic"
    }, {
      "manipulators": [
        {
          "description": "Change fn + a to \"hyper\" + a",
          "from": {
            "key_code": "a",
            "modifiers": {
              "mandatory": [
                "fn"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "a",
              "modifiers": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ]
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

Put your adaptation of one of the above configs in a JSON file under ~/.config/karabiner/assets/complex_modifications, and then you can import it from the Complex Modifications tab in Karabiner-Elements preferences. Feel free to open a PR for it, or If there's enough interest I may open a PR to add it to the list of importable configurations when I have a moment.

from ke-complex_modifications.

Grazfather avatar Grazfather commented on September 23, 2024

I do similar with a few changes:

  1. I require a two key combo (ctrl-space) (And YES this does make ctrl-space impossible.)
  2. My hyper doesn't include shift. cmd ctrl option is rare enough, plus i can just do control+space+shift if i want shift cmd ctrl option.
{
  "description": "Remap Ctrl-Space to Hyper",
  "manipulators": [
      {
          "from": {
              "key_code": "spacebar",
              "modifiers":{
                      "mandatory": ["left_control"]
              }
          },
          "to": [
              {
                  "key_code": "left_control",
                  "modifiers": [
                      "left_control",
                      "left_option",
                      "left_command"
                  ]
              }
          ],
          "type": "basic"
      }
  ]
  }

from ke-complex_modifications.

stale avatar stale commented on September 23, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ke-complex_modifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.