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

Shortcut to kill currently running game #5

Closed
MrEliptik opened this issue Mar 14, 2024 · 4 comments
Closed

Shortcut to kill currently running game #5

MrEliptik opened this issue Mar 14, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MrEliptik
Copy link
Owner

MrEliptik commented Mar 14, 2024

I added ctrl-c as a shortcut to kill the game but Godot won't receive inputs when not focused. It could probably be done with OS specific functions. If anyone want to help on that, let me know.

@MrEliptik MrEliptik added the enhancement New feature or request label Mar 14, 2024
@MrEliptik MrEliptik self-assigned this Mar 14, 2024
@MrEliptik MrEliptik added the help wanted Extra attention is needed label Mar 26, 2024
@MrEliptik MrEliptik removed their assignment Mar 26, 2024
@MrEliptik MrEliptik mentioned this issue Mar 26, 2024
@MrEliptik
Copy link
Owner Author

It seems using hooks on Windows (is there something like that on Linux and Mac?) could work but it's low level so we would need to compile a module to access it: https://learn.microsoft.com/en-us/windows/win32/winmsg/using-hooks.

Another solution could be to integrate a simple python script, which doesn't require compiling a module. If python is not available on the platform, it would simply not be used. https://github.com/boppreh/keyboard

There is a proposal about including that in Godot but I don't think it's being worked on: godotengine/godot-proposals#1919

@naturally-intelligent
Copy link

naturally-intelligent commented Apr 16, 2024

Godot by its nature is restricted to minimal OS-level features...

This is a bit of a problem for an application like this... if you dont fully trust the games running properly or leaving it unattended.

Perhaps a batch file wrapper around the whole Godot game launcher? This would handle the OS-level stuff and Godot would be just one step in the batch file to pick what process to launch next. Or Python instead of batch file? I'm not really great with Windows, so not sure what the best solution would be.

Another idea: a batch file that's running in a loop, querying Godot Game Launcher. If the game launcher responds that it wants focus, the batch file could ask the OS to give it focus.

@MrEliptik
Copy link
Owner Author

Honestly this feature is just a bonus. The application already watches the PID that was launched so I won't get stuck if the game crashes or something. It would just make life easier if we could force kill the game without going back to the launcher to hit the kill button.

I think I'll go with the python version. This app is aimed at developer showcasing their games so we can assume they have python or at least know how to get it if they want to use this feature.

@naturally-intelligent
Copy link

naturally-intelligent commented May 5, 2024

I'm part of a local nonprofit group that is making an arcade machine to showcase local games and for game jams.

Eventually the machine will need to be left unattended for long periods so being crash-resilient will be a priority

Planning on trying your launcher for this purpose .... so I may be a lot more active here lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants