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

Bind keyboard button to jump to/from /#debug view #70

Open
gabriel-v opened this issue Feb 7, 2023 · 1 comment
Open

Bind keyboard button to jump to/from /#debug view #70

gabriel-v opened this issue Feb 7, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@gabriel-v
Copy link

gabriel-v commented Feb 7, 2023

My understanding of the #debug feature and generally of the html and javascript parts of the project is really shaky.

How would I add a keyboard binding (for example F12) to go to and from the /#debug page in the game?

Without reloading the page or code, of course, otherwise I could do platform.window.location = X; platform.window.location.reload().

Is there some javascript methods I can hook into the window global on the javascript side, to enter/exit #debug REPL mode? I could then call them from python, on the F12 pygame event, using platform.window.the_hook_here.

Thanks for the great work!
PS
I stumbled upon https://pygame-web.github.io/wiki/pygbag-debug/ and the debug() function in js - is there a exit_debug() too? Also, do I just throw window.debug = debug after the function declaration in my template or is there some other way to access it from python?

@pmp-p pmp-p added the documentation Improvements or additions to documentation label Feb 8, 2023
@pmp-p
Copy link
Member

pmp-p commented Feb 8, 2023

to access the default function of the template from python side just do platform.window.debug(),
that function is expected to be customized in the template because everyone has different debugging needs. Also keep in mind most mobile device cannot show xterm.js .
Imho remote debugger is the way ( pygbag irc+websocket )

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

No branches or pull requests

2 participants