Setting Joystick as Key of keyboard game engine

hello,
firstly thank for help me…

Any1 know how to write a script in python that can import a joystick in this mode:

when i’m pressing “left axis” on my joystick, game read this action as if i’mpressing key “A”.
same things if i’m pressing “right axis” for “DKey”.

thank you very much