samvel1024 / kbct

Keyboard keycode mapping utility for Linux supporting layered configuration
MIT License
272 stars 24 forks source link

Switching modifiers and using layers with these modifiers doesn't work #7

Closed yunmikun2 closed 3 years ago

yunmikun2 commented 3 years ago

What I'm trying to do is to switch leftctrl with capslock and rightctrl with enter and make original capslock in combination with m key to send enter key code (so this last shortcut is working not only in terminal emulator but everywhere in the system).

I started with this simple config:

- keyboards:
    - "Kingston HyperX Alloy Origins Core"
    - "AT Translated Set 2 keyboard"
  keymap:
    leftctrl: capslock
    capslock: leftctrl
    rightctrl: enter
    enter: rightctrl

After ensuring this works, I tried to add the Ctrl+M shortcut:

- keyboards:
    - "Kingston HyperX Alloy Origins Core"
    - "AT Translated Set 2 keyboard"
  keymap:
    leftctrl: capslock
    capslock: leftctrl
    rightctrl: enter
    enter: rightctrl
  layers:
     - modifiers: ['leftctrl']
       keymap:
         m: enter

I expected that it would just work, but got only original capslock + m working as enter. The switching of leftctsl and capslock was broken.

Is it even possible to have this functionality (Ctrl+M) anabled with this tool?

yunmikun2 commented 3 years ago

Ah, no, nevermind. It started working like this:

- keyboards:
    - "Kingston HyperX Alloy Origins Core"
    - "AT Translated Set 2 keyboard"
  keymap:
    leftctrl: capslock
    capslock: leftctrl
    rightctrl: enter
    enter: rightctrl
  layers:
    - modifiers:
        - capslock
      keymap:
        m: enter
    - modifiers:
        - enter
      keymap:
        m: enter

But it was acting pretty strange while I was experimenting.