Method .ascii_key() this is used to enter characters. These are different concepts, interception of buttons and entering characters of letters from the keyboard. This will not work on keyboards if you switch the language layout.
ADD:
Hmm, I checked it works when switching layouts, which is weird. In any case, gamepads do not have ASCII mode.
Perhaps your problem with this approach is that you don’t use a dictionary with button status flags. You can take a look at the roaming-ralph example to familiarize yourself with this approach.
There are a lot more but didn’t want to type them all out. They seem to correspond to gamepad input events, similar to the ones for KeyboardButton().
For gamepad and other types of input devices, you can also use the InputDevice class. The steering wheel, flight stick and device_tester samples that ship with panda3d do show how these can be set up and used.
If you want to get the pressed state of a button, you can do myGamepad.findButton(myButtonHandler).pressed