Mac low-level keyboard device corresponding to Linux /dev/input?
Asked Answered
S

1

8

What is the name of the low-level keyboard device in macOS (somewhere in Darwin / Mach / IOKit) that corresponds to /dev/input in Linux? (e.g. /dev/input/event0)

Context: I'm asking because want to 'map' the Mac device to a Docker container running Linux.

Sapota answered 19/12, 2017 at 17:47 Comment(1)
As a side note regarding your context remark: as far as I'm aware, Docker containers on macOS usually run in an independent Linux kernel running below a hypervisor called HyperKit. I don't know if each container gets its own VM, or if the container features are used on a single VM's Linux kernel. In any case, HyperKit currently doesn't support USB device pass-through. Other virtualisation environments such as VirtualBox, VMWare Fusion and Parallels do support direct USB passthrough on Mac, in case that's an option for you.Heinrike
H
8

There is no such direct correspondence with a /dev/ node on macOS. HID events are (eventually) processed in the IOHIDSystem class in the kernel and are transferred to user space into WindowServer via the IOHIDUserClient. Applications can also directly access aspects of a HID device directly via the IOHIDLib, which uses IOHIDLibUserClient to get kernel HID data.

macOS only uses /dev/ nodes for a handful of device types, notably block devices (diskXsY, rdiskXsY), serial ports, and the traditional UNIX virtual devices such as null, zero, random, etc. There are also a few BSDisms, such as BPF. Almost everything else is handled only via IOKit.

Heinrike answered 22/12, 2017 at 20:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.