Page 1 of 1

[1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 9:50 am
by Koen02
⌘ (Cmd) + W is a system shortcut in Mac OS to close an application. I have pressed this in-game multiple times (accidentally) and it closes the game and sets you back to the latest autosave.

An easy fix is to intercept the shortcut and do nothing within the factorio code.

Facorio Version: 1.1.76 (Happening since at least the apple silicon update)
Device: Apple MacBook Pro 14 inch, M1 Pro
Keyboard: Built-in keyboard & Logitech MX Keys (mac compatible)
Version: MacOS Ventura 13.2.1


EDIT: also happens on 1.1.78

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 11:37 am
by Koub
Resolved on 1.1.78 :
viewtopic.php?f=3&t=105647
[Koub] Moved to Resolved

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 11:46 am
by Xorimuth
Koub wrote:
Tue Mar 21, 2023 11:37 am
Resolved on 1.1.78 :
viewtopic.php?f=3&t=105647
[Koub] Moved to Resolved
No, this is not the same as 105590

That one was specifically for a conflicting keybind when using AZERTY.

This one is just that in general, Command+W is far to easy to accidentally press when playing (I’ve done it many times myself). Like command+C to copy, and then you press W to move up just before letting go of Command.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 11:50 am
by Koen02
I don't use AZERTY. There is no interference with in-game shortcuts. The problem is accidentally hitting Cmd + W. The quitting without saving still happens on 1.1.78.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 12:40 pm
by jodokus31
I figured, that an application can't do anything to change those macOS system-hotkeys, unless I missing something.
You could also change WASD control to somewhere else, factorio has an incredible flexibility, when it comes to key rebinds.

Coming from windows/linux, I changed Cmd to Ctrl key on my external keyboard. And I always press CmdQ or CmdW at some point. So best is, to intercept in systemsettings for this application.

I don't understand why MacOS has to behave very contrary compared to windows in very basic things. I probably never get used to it.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 1:14 pm
by Koen02
jodokus31 wrote:
Tue Mar 21, 2023 12:40 pm
I figured, that an application can't do anything to change those macOS system-hotkeys, unless I missing something.
An application can easily intercept hotkeys on MacOS, for example browsers like firefox or chromium rebind it to "close tab".

jodokus31 wrote:
Tue Mar 21, 2023 12:40 pm
I don't understand why MacOS has to behave very contrary compared to windows in very basic things. I probably never get used to it.
It's similar to windows' alt + f4.
I don't think it's fair to see windows as a role model for all other OS's. MacOS probably has as much history as windows.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 1:35 pm
by Koub
Xorimuth wrote:
Tue Mar 21, 2023 11:46 am
No, this is not the same as 105590

That one was specifically for a conflicting keybind when using AZERTY.

This one is just that in general, Command+W is far to easy to accidentally press when playing (I’ve done it many times myself). Like command+C to copy, and then you press W to move up just before letting go of Command.
Koen02 wrote:
Tue Mar 21, 2023 11:50 am
I don't use AZERTY. There is no interference with in-game shortcuts. The problem is accidentally hitting Cmd + W. The quitting without saving still happens on 1.1.78.
Sorry, misunderstood the actual issue. Not a bug though, it's a suggestion/request
[Koub] Moving the thread to the appropriate subforum

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Tue Mar 21, 2023 7:43 pm
by jodokus31
Koen02 wrote:
Tue Mar 21, 2023 1:14 pm
jodokus31 wrote:
Tue Mar 21, 2023 12:40 pm
I figured, that an application can't do anything to change those macOS system-hotkeys, unless I missing something.
An application can easily intercept hotkeys on MacOS, for example browsers like firefox or chromium rebind it to "close tab".
I don't use CtrlQ or CtrlW as hotkey. It's more some item transfer actions (Ctrl+Click) while running via WASD.
Maybe factorio could make them no-ops for the system, if possible.
Koen02 wrote:
Tue Mar 21, 2023 1:14 pm
jodokus31 wrote:
Tue Mar 21, 2023 12:40 pm
I don't understand why MacOS has to behave very contrary compared to windows in very basic things. I probably never get used to it.
It's similar to windows' alt + f4.
I don't think it's fair to see windows as a role model for all other OS's. MacOS probably has as much history as windows.
I don't know who started to diverge, it's just a fact.
I don't know, how good you can customize windows to apply to macOS behavior (probably quite poor, too), but macOS makes it pretty hard to behave similar to windows. It's makes using both systems pretty annoying so far. I have to download apps and stuff to be able to operate it somewhat similar. And I don't want to relearn everything.
I wonder, if macOS has different desktop environments, which are better for people coming from windows/linux. Linux is the most customizable.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Fri Mar 31, 2023 9:04 pm
by Factoruser
Koen02 wrote:
Tue Mar 21, 2023 9:50 am
⌘ (Cmd) + W is a system shortcut in Mac OS to close an application.
No, it's the standard shortcut to close the active WINDOW. ⌘Q is the system shortcut to quit an application. It's strange whether Factorio should react to ⌘W, but this should be removed. Further it's possible to catch ⌘Q like Alt+F4 on Windows. This is not a forced kill - it's propably SIGTERM, but not SIGKILL.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Mon Apr 24, 2023 1:30 pm
by StrangePan
The "Close window" shortcut (Cmd+W) will be disabled starting from 1.1.82. Cmd+Q (Quit Factorio) and Cmd+Opt+W (Close all windows) will continue to work.

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Thu Apr 27, 2023 5:21 pm
by Siarhei
The "Close window" shortcut (Cmd+W) will be disabled starting from 1.1.82. Cmd+Q (Quit Factorio) and Cmd+Opt+W (Close all windows) will continue to work.
It's a greate news about Cmd+W. It would be also awesome to have autosave before quite. Sometimes I close Factorio via Cmd+Q by accident.
Anyway thanks a lot for Cmd+w, it's very useful

Re: [1.1.76][mac-arm] ⌘ (Cmd) + W closes the game without saving

Posted: Wed May 24, 2023 5:52 pm
by keymone
Thank you so much! i just closed factorio by cmd+w accidentally while reading this topic 😅

to me every time this happened was when running upwards and trying to bring up the copy tool