Python for Joystick buttons?

Hello, is there any Python code for handling joystick events? For example (psudo code) myJoystickSensor.isButtonDown(number) or something similar?

Thanks

Sorry everyone, I’ve found what I’m looking for:

getButtonValue()