Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change keybindings for sdl2 #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tk744
Copy link

@tk744 tk744 commented Nov 27, 2023

Added feature to change the sdl2 keybindings as suggested by this issue.

Usage:

from pyboy.plugins.window_sdl2 import set_keybinding

set_keybinding(sdl2.SDLK_w, WindowEvent.PRESS_ARROW_UP, WindowEvent.RELEASE_ARROW_UP)
set_keybinding(sdl2.SDLK_s, WindowEvent.PRESS_ARROW_DOWN, WindowEvent.RELEASE_ARROW_DOWN)
set_keybinding(sdl2.SDLK_a, WindowEvent.PRESS_ARROW_LEFT, WindowEvent.RELEASE_ARROW_LEFT)
set_keybinding(sdl2.SDLK_d, WindowEvent.PRESS_ARROW_RIGHT, WindowEvent.RELEASE_ARROW_RIGHT)

@tk744 tk744 changed the title Change Keybindings for sdl2 Change keybindings for sdl2 Nov 27, 2023
@Baekalfen
Copy link
Owner

Thank you for your PR! I'll have to consider it. I would have preferred if it was a generic solution for OpenGL and a future window type too, but I don't have a good idea on how to do it. Problem is that once it's in, I'll have to keep supporting it going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants