Can Keyboard Maestro detect non-keyboard devices such as rotary encoders?

Bit of a strange question, but I have a standalone rotary encoder with a push button/layer option. While it has it's own configurator (known as Vial), I find it to be a bit limited.

While I have found an indirect way to have the encoder talk to Keyboard Maestro (I've chosen pressing down to = a function key), is there a way to have Keyboard Maestro then alter a state on the encoder? Specifically, to change the layer? Thanks!

Maybe @peternlewis might shed some light on this question

Would the device key trigger have anything to do with this? Thanks!

Keyboard Maestro might be able to detect it with the USB Device Key trigger. Try it and see. It either can or it cant, depending on the device.