ppizarror / pygame-menu

A menu for pygame. Simple, and easy to use
https://pygame-menu.readthedocs.io/
Other
555 stars 141 forks source link

Selector and Joystick #392

Closed AdamCyffka closed 2 years ago

AdamCyffka commented 2 years ago

Hey, is there a way to override default enter and arrows keys for selector component? We would like to use joystick functions from pygame.

ppizarror commented 2 years ago

Yes sure, you can override any control. See https://github.com/ppizarror/pygame-menu/blob/master/test/test_controls.py#L46-L78

For such purpose you must:

import pygame_menu.controls as ctrl
ctrl.KEY_APPLY = pygame.K_END

Then, the library would use K_END as the control to "apply" widgets. The same can be done with enter, arrows, etc...

AdamCyffka commented 2 years ago

Ok perfect, it's working with the joystick initialization. But we have an issue during right or left event, when the joystick return to idle state, it's triggers left/right, any idea?

ppizarror commented 2 years ago

Can you provide a minimal working example?

ppizarror commented 2 years ago

Hi @AdamCyffka, any updates?

ppizarror commented 2 years ago

I'll close this issue for now. If you have any updates, let me know. Greetings!

AdamCyffka commented 2 years ago

Hey, we had taken a break on our project. To come back to our problem, here is a video that will be more telling of the problem with our joystick. When we go left and then return to the center, it goes to the left and then to the right and not left and nothing. Do you have any idea?

https://streamable.com/l75kqh