diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2022-11-09 10:05:19 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2022-11-09 10:05:19 +0000 |
commit | 13f98e113fb16ed4f0c4c050a4c526e84c4bd826 (patch) | |
tree | d86836d12065a3279ba7b6001fc90aa237a88bb6 /sys/arch/arm64/dev | |
parent | 7c3d55ee60505232a7ab60d23d4272827bdbe132 (diff) |
translate Fn+(1-10,-,=) keys to F1-F12 on M1 laptops with a touchbar
ok kettenis@, miod@
Diffstat (limited to 'sys/arch/arm64/dev')
-rw-r--r-- | sys/arch/arm64/dev/aplhidev.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/aplhidev.c b/sys/arch/arm64/dev/aplhidev.c index dc221a0f677..f1c3f5ad0e7 100644 --- a/sys/arch/arm64/dev/aplhidev.c +++ b/sys/arch/arm64/dev/aplhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplhidev.c,v 1.8 2022/10/02 19:00:46 kettenis Exp $ */ +/* $OpenBSD: aplhidev.c,v 1.9 2022/11/09 10:05:18 robert Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2013-2014 joshua stein <jcs@openbsd.org> @@ -33,6 +33,8 @@ #include <dev/ofw/ofw_gpio.h> #include <dev/ofw/ofw_pinctrl.h> +#include <dev/usb/usbdevs.h> + #include <dev/wscons/wsconsio.h> #include <dev/wscons/wskbdvar.h> #include <dev/wscons/wsksymdef.h> @@ -526,8 +528,16 @@ aplkbd_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (hid_locate(aa->aa_desc, aa->aa_desclen, HID_USAGE2(HUP_APPLE, HUG_FN_KEY), - 1, hid_input, &kbd->sc_fn, NULL)) - kbd->sc_munge = hidkbd_apple_munge; + 1, hid_input, &kbd->sc_fn, NULL)) { + switch (sc->sc_hidev->sc_product) { + case USB_PRODUCT_APPLE_WELLSPRINGM1_J293: + kbd->sc_munge = hidkbd_apple_tb_munge; + break; + default: + kbd->sc_munge = hidkbd_apple_munge; + break; + } + } if (kbd->sc_console_keyboard) { extern struct wskbd_mapdata ukbd_keymapdata; |