Giter Site home page Giter Site logo

Comments (2)

kzsh avatar kzsh commented on June 22, 2024

This is a tricky one. I've come up with one possible solution (below).

The major issue is getting shift-command to map to command while command is already mapping to control. After some experimentation, the only way I've found so far to get consistent behavior is to map command to control, shift+command to command, shift + control to command.

Two mappings are required to handle both the case where shift is hit before the physical command key and the case where command is hit before shift.

I imagine there is a simpler combination of rules I haven't hit on yet, but this should give you your desired behavior.

{
  "title": "Change control and command in Terminal.App",
  "rules": [
    {
      "description": "Change command to control and shift + command to command in Terminal.App",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_shift",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_command"
            }
          ],
          "conditions": [
            {
              "bundle_identifiers": [
                "^com\\.apple\\.Terminal$"
              ],
              "type": "frontmost_application_if"
            }
          ]
        }, {
          "type": "basic",
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "mandatory": [
                "left_shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_command"
            }
          ],
          "conditions": [
            {
              "bundle_identifiers": [
                "^com\\.apple\\.Terminal$"
              ],
              "type": "frontmost_application_if"
            }
          ]
        }, {
          "type": "basic",
          "from": {
            "key_code": "left_command"
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ],
          "conditions": [
            {
              "bundle_identifiers": [
                "^com\\.apple\\.Terminal$"
              ],
              "type": "frontmost_application_if"
            }
          ]
        }
      ]
    }
  ]
}

from ke-complex_modifications.

kzsh avatar kzsh commented on June 22, 2024

Closing this issue as resolved. If you need anything further, please feel free to reopen it!

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.