Simulating Keyboard

I want to send keys to game.
Tried pydirectinput, pynput, and ctypes none of them working at the moment. Any advices ?