mooz / xkeysnail

Yet another keyboard remapping tool for X environment
890 stars 112 forks source link

Function keys on a T2 MacBook Pro running Ubuntu 20.04 #155

Open pajatopmr opened 2 years ago

pajatopmr commented 2 years ago

Using only the configuration shown below I cannot use any function keys. The alternate hardware controls on the touch-bar are shown (brightness, audio) and the fn key (Key.FN) when held down does not switch the touch-bar to function keys, the expected behavior.

# -*- coding: utf-8 -*-

import re
from xkeysnail.transform import *

# define timeout for multipurpose_modmap
define_timeout(1)

# [Multipurpose modmap] Give a key two meanings. A normal key when pressed and
# released, and a modifier key when held down with another key. See Xcape,
# Carabiner and caps2esc for ideas and concept.
define_multipurpose_modmap(
    # Enter is enter when pressed and released. Control when held down.
    {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL],
    Key.CAPSLOCK: [Key.F13, Key.LEFT_CTRL]}
    # Capslock is escape when pressed and released. Control when held down.
    # {Key.CAPSLOCK: [Key.ESC, Key.LEFT_CTRL]
    # To use this example, you can't remap capslock with define_modmap.
)
joshgoebel commented 2 years ago

and the fn key (Key.FN) when held down does not switch the touch-bar to function keys, the expected behavior.

Is that hardware expected to actually work in other operating systems than Mac OS? I wouldn't automatically assume that...

Not sure this has anything to do with us?

cosmonaut-laika commented 2 years ago

I have the same problem on lenovo x1 carbon 6th gen running arch linux. Function keys stopped working as they're supposed to. They're now outputing different keys, for instance f6 outputs tilde

joshgoebel commented 2 years ago

Can either of you run evtest and show us what output those keys even produce? If a key isn't a modifier it should just "pass thru" at a low-level... ie the key you type is the key we pass on... (and then try again and show us the xkeysnail log) Though I can't remember what detail it logs normal keystrokes (if at all)... my fork https://github.com/joshgoebel/keyszer logs plenty when in verbose mode, so that might be worth a try if you get nowhere with xkeysnails logging.