macOS support #6
Replies: 3 comments 1 reply
-
So there's 2 modes of operation, 𝑥MK and 𝑥MK Native. Both require the Linux input event system and the corresponding python-evdev python module in order to grab and read the keyboard. 𝑥MK Native additionally requires an environment that supports Zephyr native posix (probably Linux only) and a usbip client. For 𝑥MK on macOS, there are a few possibilities. One would be to replace the use of python-evdev with the native equivalent. KMonad can grab and read keyboards on macOS but I haven't looked into the details. Some options are described at https://github.com/kmonad/kmonad/blob/master/doc/installation.md#macos but that seems to be for output rather than input, which isn't required for 𝑥MK. Another option would be to run xmk in a VM, use the native keyboard passthrough for input, and also connect the tty device for output. For 𝑥MK Native on macOS, you'd have the same issues and possible solutions as for 𝑥MK above, plus the additional requirements mentioned previously. For the Zephyr native posix environment you'd probably need to use a VM. For the usbip client https://www.virtualhere.com/ might be usable. Alternatively xmk could be modified for bidirectional comms and key event generation to remove the need for usbip. Also see #4. |
Beta Was this translation helpful? Give feedback.
-
Here is where the keyboard is grabbed in KMonad on macOS, which looks like just IOKit: https://github.com/kmonad/kmonad/blob/a22e0bad9e76b01c7b9e56f193e07c615e82effa/c_src/mac/keyio_mac.hpp#L95. This might be usable as a multi-platform alternative to python-evdev: https://github.com/trezor/cython-hidapi. Grabbing the keyboard seems to be an open issue but supported on macOS at least: signal11/hidapi#302. |
Beta Was this translation helpful? Give feedback.
-
Another option to consider is https://pynput.readthedocs.io/en/latest/keyboard.html#pynput.keyboard.Listener with suppress. |
Beta Was this translation helpful? Give feedback.
-
just discovered it, what a fantastic idea, I love it
what would it take to have this run on macOS?
Beta Was this translation helpful? Give feedback.
All reactions