Skip to content

Instantly share code, notes, and snippets.

@vsalex
Created December 13, 2017 12:59
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vsalex/eac8c27bc7cf428ba8e19671cdb34142 to your computer and use it in GitHub Desktop.
Save vsalex/eac8c27bc7cf428ba8e19671cdb34142 to your computer and use it in GitHub Desktop.
{
"title": "Languages",
"rules": [
{
"description": "Command + Shift to Command + e",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "e",
"modifiers": [
"left_command"
]
}
]
}
]
}
]
}
@OlivierLi
Copy link

I suggest using "to_if_alone" on line 17 so that this does not trigger when using "command+shift+t" in Chrome for example.

@Vashkatsi
Copy link

This is great, thank you

@onemorepash
Copy link

onemorepash commented Aug 6, 2022

Found this and was happy. Thanks man!

For me it only worked for first "Command" (press and hold) than "Shift" but not "Shift" than "Command". So I added one more rule to make it work. Plus replaced "to" by "to_if_alone", as @OlivierLi proposed above.

Here is the result:

{
  "title": "Languages",
  "rules": [
    {
      "description": "Command + Shift to Command + e",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_shift",
            "modifiers": {
              "mandatory": [
                "left_command"
              ]
            }
          },
          "to_if_alone": [
            {
              "key_code": "e",
              "modifiers": [
                "left_command"
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "mandatory": [
                "left_shift"
              ]
            }
          },
          "to_if_alone": [
            {
              "key_code": "e",
              "modifiers": [
                "left_command"
              ]
            }
          ]
        }
      ]
    }
  ]
}

@lirdis
Copy link

lirdis commented Aug 21, 2022

This is freakin' gold!! Except... For some reason, this still messes up every Shift + Cmd + {key} combination that I have... Can anything be done to accommodate to this situation? Or should it work and maybe it's just another configuration that I have? :-) @onemorepash

@onemorepash
Copy link

onemorepash commented Aug 21, 2022

@lirdis yeah, I also noted that there is still some stuff which doesn't work or work a bit strange with this configuration:

  • "Shift+Command+R" in Firefox to reload a page with cache flushed: only works if I press and hold "Command" than "Shift", than "R" but not "Shift" than "Command". Which is a bit clumsy (I'm not used to) but works.
  • Shift+Command+V to paste without formatting doesn't seem to work. "first Shift, than Command than V" just gives V and "Command than Shift than V" pastes with formatting. But here, to be honest, it's a Mac-specific thing, I'm not sure if it always worked for me even before.

I haven't yet bothered to troubleshoot this (not enough tedious as a problem :) If I ever find a solution, I'll let know here.

Please also do if somebody else knows how to fix this.

@onemorepash
Copy link

Ah, and also Shift+Command+4 or +5 for screnshots/screencasts. But here I just redefined them to Control+Command+4/5.

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