Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1352  / 2 Years ago, mon, february 21, 2022, 6:21:29

I have this helpful setting enabled in Tweak Tools when I use an annoying external Apple magic keyboard:


enter image description here


This setting makes the keyboard function in my view normal (super key is to the right of the control key).


However, this setting in tweak tool also affect my laptop own keymap. Can I somehow make this setting only for this annoying external Apple magic keyboard?


More From » gnome

 Answers
1

Turns out my coworker had the same issue. With his permission here's the solution that worked right away:


First run this and scroll to the information about the keyboard
Run cat /proc/bus/input/devices | less


I: Bus=0005 Vendor=004c Product=026c Version=0160
N: Name="Magic Keyboard with Numeric Keypad"
P: Phys=44:e5:17:96:76:24
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10:1.0/bluetooth/hci0/hci0:256/0005:004C:026C.0007/input/input38
U: Uniq=c4:14:11:03:c2:de
H: Handlers=sysrq kbd event20 leds
B: PROP=0
B: EV=120013
B: KEY=10000 0 0 1 1007b00001007 ff9f207ac14057ff ffbeffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=1f

Now construct an id via this way:


evdev:input:b<bus_id>v<vendor_id>p<product_id>e<version_id>-<modalias>

Where version and modalies don't matter. I get this:


evdev:input:b0005v004Cp026C*


Next create this file


etc/udev/hwdb.d/60-applekeyboard.hwdb

I don't think the name matters but I am not sure.


The file should contain the ID we just made and the remap of keys:


# Apple magic
evdev:input:b0005v004Cp026C*
KEYBOARD_KEY_700e2=leftmeta
KEYBOARD_KEY_700e3=leftalt

How do you find the names? just execute sudo evtest find your keyboard and press the key you want to chage.. Output looks like this:


Event: time 1644400418.762658, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1644400418.762658, type 1 (EV_KEY), code 56 (KEY_LEFTMETA), value 1

Use that output to construct the desired key and change.


Next, sudo run these commands to update:


systemd-hwdb update
udevadm control --reload-rules
udevadm trigger

Then you are done.


[#832] Tuesday, February 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ndeecru

Total Points: 109
Total Questions: 128
Total Answers: 117

Location: Czech Republic
Member since Thu, Aug 11, 2022
2 Years ago
ndeecru questions
Mon, Jun 20, 22, 04:53, 2 Years ago
Thu, Mar 10, 22, 18:53, 2 Years ago
Thu, Oct 14, 21, 20:53, 3 Years ago
Thu, Apr 28, 22, 10:16, 2 Years ago
;