Karabiner-Elements icon indicating copy to clipboard operation
Karabiner-Elements copied to clipboard

'fn' is input as 'Globe'

Open weensy opened this issue 2 years ago • 3 comments

I am using 'caps_lock' modified to 'fn' as shown below: Screen Shot 2022-05-21 at 21 50 04

I updated the OS today to Monterey 12.4. From then on, when I press 'fn' (actually 'caps_lock' for me), the input source changed.

I found the following first sight setting in System Preferences, which seems to be the cause. Screen Shot 2022-05-21 at 21 55 01

I solved it by swapping 'Caps Lock' and 'Globe' of 'Karabiner DriverKit VirtualHIDKeyboard 1.6.0' in [Modifier Keys...]. Screen Shot 2022-05-21 at 22 04 20

However, there may be users who want to use both 'fn' and 'Globe'. So is there any way to solve this?

weensy avatar May 21 '22 13:05 weensy

Is input source changed only when fn is pressed alone? That is, does it change when pressing, for example, fn+F4?

MuhammedZakir avatar May 21 '22 16:05 MuhammedZakir

@MuhammedZakir Combination doesn't change. It only changes on single input.

weensy avatar May 22 '22 05:05 weensy

Then, you can do something like:

{
  "description": "caps lock -> fn ; does nothing when pressed alone",
  "type": "basic",
  "parameters": {
    "basic.to_if_held_down_threshold_milliseconds": 1
  },
  "from": {
    "key_code": "caps_lock",
    "modifiers": {
      "optional": ["any"]
    }
  },
  "to_if_held_down": [{
    "key_code": "fn"
  }]
}

Note:

  1. "key_code": "fn" may not work. It it doesn't, you need to replace it with what you get in EventViewer when you press fn.
  2. I haven't tested this, so I am not sure whether this work as expected. Mainly, I don't know if a dummy to_if_alone is needed to make this work correctly.
    • You may add to_if_alone to map caps_lock to some other key, or itself, when pressed alone.

MuhammedZakir avatar May 22 '22 15:05 MuhammedZakir