-
Notifications
You must be signed in to change notification settings - Fork 6
/
95-keymap-apple-kdb.rules.in
33 lines (27 loc) · 1.63 KB
/
95-keymap-apple-kdb.rules.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# apple-kbd, Apple Aluminium Keyboards keymap configuration rules
# Copyright (c) 2009-2011 Damien Ciabrini - damien.ciabrini@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
ACTION!="add|change", GOTO="apple_kbd_end"
SUBSYSTEM!="input", GOTO="apple_kbd_end"
KERNEL!="event[0-9]*", GOTO="apple_kbd_end"
ENV{ID_VENDOR_ID}!="05ac", GOTO="apple_kbd_end"
ENV{ID_INPUT_KEYBOARD}!=1, GOTO="apple_kbd_end"
ENV{ID_MODEL_ID}!="022[0-2]|024f|025[0-1]", GOTO="apple_kbd_end"
ENV{ID_MODEL_ID}=="0220", ENV{XKBMODEL}="applealu_ansi"
ENV{ID_MODEL_ID}=="0221", ENV{XKBMODEL}="applealu_iso"
ENV{ID_MODEL_ID}=="0222", ENV{XKBMODEL}="applealu_jis"
ENV{ID_MODEL_ID}=="024F", ENV{XKBMODEL}="applealu_ansi"
ENV{ID_MODEL_ID}=="0250", ENV{XKBMODEL}="applealu_iso"
ENV{ID_MODEL_ID}=="0251", ENV{XKBMODEL}="applealu_jis"
ACTION=="add|change", IMPORT{program}="/bin/grep ^apple_kbd_ @CONFIGDIR@/apple-kbd"
# commented until the fn key is known by udev
# ENV{apple_kbd_ALUKBD_FN_AS_INS}!="1", RUN+="keymap $env{DEVNAME} 0xff0003 464"
ENV{apple_kbd_ALUKBD_FN_AS_INS}=="1", RUN+="keymap $env{DEVNAME} 0xff0003 insert"
ENV{apple_kbd_ALUKBD_XKB_PC_KEYS}=="1", ENV{XKBOPTIONS}="apple:alupckeys,$env{XKBOPTIONS}"
ENV{apple_kbd_ALUKBD_XKB_PC_KEYS}=="1", IMPORT{program}="/bin/sh -c 'echo XKBOPTIONS=$${XKBOPTIONS%,}'"
ENV{apple_kbd_ALUKBD_KMOD_FNMODE}=="[012]", RUN+="/bin/sh -c 'echo $env{apple_kbd_ALUKBD_KMOD_FNMODE} > /sys/module/hid_apple/parameters/fnmode'"
LABEL="apple_kbd_end"