How to send an input key event from code?

Unfortunately, this doesn’t work for Enhanced Input. Does anyone know how to achieve the same result for the Enhanced Input?