I'm afraid that this isn't possible, since the evdev interface is specific to the Linux kernel. Even if you managed to install it, it would not work as there are no /dev/input/*
devices from which events can be read on MacOS.
If you're looking for a portable solution, you may want to look into a library that abstracts event handling, such as pygame or SDL. This answer also covers the options that you have for processing events in MacOS.