pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.31k stars 830 forks source link

Simultaneous pressing of remapped symbol and it's shifted version doesn't work #2210

Closed dzmitry-paulenka closed 4 years ago

dzmitry-paulenka commented 4 years ago

I have two manipulators, mapping symbol and it's shifter version to R_Cmd+<Letter>

E.g:

  R_Cmd+s => '+' 
  R_Cmd+g => '='

In karabiner I've translated it to this:

"rules": [{
  "description": "Quick symbols",
  "manipulators": [{
    "from": {
      "key_code": "s",
      "modifiers": {
        "mandatory": ["right_command"]
      }
    },
    "to": [{
      "key_code": "equal_sign",
      "modifiers": ["left_shift"]
    }],
    "type": "basic"
  }, {
    "from": {
      "key_code": "g",
      "modifiers": {
        "mandatory": ["right_command"]
      }
    },
    "to": [{
      "key_code": "equal_sign"
    }],
    "type": "basic"
  }]
}]

Now the problem is that when I'm holding R_Cmd, then quickly press s and g (i.e. trying to type '+=') it only types +. Same for reversed =+. It only works, when I fully release first key, then press second. And so the issue seems to be due to me still holding the first key, when I've already started pressing second..

I've tried to play with the timings, but it doesn't seem to affect this.

This is a screenshot of events captured, when I type quickly and the symbol is missing (I'm releasing R_Cmd at the very end):

not-ok

These are events when I fully release 1st key:

ok
dzmitry-paulenka commented 4 years ago

Ok, so at the end I'm using this setup in goku.

   [:!Es {:key :!Sequal_sign :repeat false}]
   [:!Eg {:key :equal_sign :repeat false}]

Which translates to this:

"rules": [{
  "description": "Quick symbols",
  "manipulators": [{
    "from": {
      "key_code": "s",
      "modifiers": {
        "mandatory": ["right_option"]
      }
    },
    "to": [{
      "key_code": "equal_sign",
      "modifiers": ["left_shift"],
      "repeat": false
    }],
    "type": "basic"
  }, {
    "from": {
      "key_code": "g",
      "modifiers": {
        "mandatory": ["right_option"]
      }
    },
    "to": [{
      "key_code": "equal_sign",
      "repeat": false
    }],
    "type": "basic"
  }]
}]

I think It's not ideal, because It disables the ability to hold a key for repetition. But in practice, it's actually rarely needed. And at least this way all the symbols are immidiatly typed as expected