-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Impl cmd q macos #674
base: master
Are you sure you want to change the base?
Impl cmd q macos #674
Conversation
…en a key is pressed in conjuction with the Command key (LeftSuper or RightSuper) on macOS. Also added a filed to Input called 'quit' which gets set when the player pressed LeftSuper or RightSuper key and Q. The 'quit' filed is set to true, and this is used to update the context by setting 'quit_requested' to true which closes the window ending the program.
… set, it is verified one of the super keys is pressed along with Q being pressed.
…ions in key_down() in src/ui.rs.
ui.key_down(megaui::KeyCode::Control, shift, ctrl, cmd); | ||
} | ||
if ui.input.quit { | ||
get_context().quit_requested = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macroquad::ui is a module about drawing game UI, I am not quite sure if handling platform quit request belongs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am inclined to agree. Would this be better moved to something like begin_frame() in src/lib.rs, or could you make a suggestion where a platform quit request would be better handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
begin_frame looks like a right place to me.
Justa side question, but is manual handling Cmd-Q a common practice on MacOs? Isnt there some sort of a system-level hotkeys for this kind of things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only thought about that after I last commented. I can do some research; I bet I can find something. I will get back to this in a day or two with relevant changes.
Adds Cmd+Q functionality for MacOS - issue #649.