jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
3.18k stars 130 forks source link

help: remap fn key nixos-asahi m1 #1202

Open aspauldingcode opened 3 months ago

aspauldingcode commented 3 months ago

Requirements

Describe the bug

I'm not sure how to remap macbook air fn key to left control.

Relevant kanata config

my config:

{ config, pkgs, lib, ... }:

{
  services.kanata = {
    enable = true; # Enable the Kanata service

    keyboards = {
      "internalKeyboard" = {
        devices = [ "/dev/input/event2" ]; # Use the event associated with your internal keyboard

        config = ''
          (defsrc
            grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
            tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
            caps a    s    d    f    g    h    j    k    l    ;    '    ret
            lsft z    x    c    v    b    n    m    ,    .    /    rsft
            lctl lalt lmet           spc            ralt rmet rctl
          )

          (deflayer default
            grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
            tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
            caps a    s    d    f    g    h    j    k    l    ;    '    ret
            lsft z    x    c    v    b    n    m    ,    .    /    rsft
            lctl lmet lalt           spc            ralt rmet rctl
          )

          (deflayer dvorak
            grv  1    2    3    4    5    6    7    8    9    0    [    ]    bspc
            tab  '    ,    .    p    y    f    g    c    r    l    /    =    \
            caps a    o    e    u    i    d    h    t    n    s    -    ret
            lsft ;    q    j    k    x    b    m    w    v    z    rsft
            lctl lmet lalt           spc            ralt rmet rctl
          )
        ''; # The config must be a string, written in Kanata's expected format
      };
    };
  };
}

To Reproduce

not really a bug

Expected behavior

replace left fn key with control (so control is left fn and left control key on the built-in macbook air keyboard)

Kanata version

kanata 1.6.1

Debug logs

No response

Operating system

Linux

Additional context

No response

jtroo commented 3 months ago

What does evtest show when pressing the fn key?