While writing controller support for PGZero, I noticed that the behaviour described in the documentation string of prepare_handler in game.py does not seem to be correct. It states:
The wrapped handler will also map certain parameter values using callables from EVENT_PARAM_MAPPERS; this ensures that the value of 'button' inside the handler is a real instance of constants.mouse, which means (among other things) that it will print as a symbolic value rather than a naive integer.
The values given to the mouse functions being proper values of the mouse enum does not appear to be the case however. When running the following simple example with pgzrun, only normal integer values are printed.
def on_mouse_down(button):
print(button)
I must admit I don't currently understand how prepare_handler really works, so I don't think I can fix this myself.
While writing controller support for PGZero, I noticed that the behaviour described in the documentation string of
prepare_handleringame.pydoes not seem to be correct. It states:The values given to the mouse functions being proper values of the
mouseenum does not appear to be the case however. When running the following simple example withpgzrun, only normal integer values are printed.I must admit I don't currently understand how
prepare_handlerreally works, so I don't think I can fix this myself.