infinite-mac icon indicating copy to clipboard operation
infinite-mac copied to clipboard

Detect and auto-enable COMMAND -> CONTROL key swap for Mac users?

Open that-ben opened this issue 1 year ago • 2 comments

Hi! I just received my iMac M3 and I found out that there's an annoyance in IM (e.g. Mac OS 9, but will do that also under Mac OS 8 and 7) when you use IM under a Mac. You see, under Windows, if I do ALT-W to close a window, it works as intended. But under Mac, if I do COMMAND-W, it closes the browser tab entirely. I know I can swap COMMAND for the CONTROL key with 2 mouse clicks, but I need to do that every time I launch the emulator.

Couldn't we simply detect the platform using Javascript and if under any kind of Mac, then automatically enable the COMMAND -> CONTROL key swap? I'm sure this would make a lot of Mac users happy! I don't see the point of leaving it disabled under Mac, as that key combo is completely unusable in a Mac web browser.

that-ben avatar Nov 09 '23 15:11 that-ben

Something to consider, though I'd probably need to have an intro banner about it, because it's an unusual default for Mac users.

FWIW, the control/command key swap is now actually persistent (fixed in https://github.com/mihaip/infinite-mac/commit/52204d3a9c482e62be6ab081480611ab8a3add4e#diff-1c4d2da4d74e6951b49b86fc8ea7676a0d4b248a2037f2cd1fc3cf8131c83609), so you should need to do this only once.

mihaip avatar Nov 12 '23 20:11 mihaip

Yes but as it sits right now, it's unusable under a Mac because CMD-W closes the whole web browser tab until ones applies the CTRL/CMD key swap.

EDIT: I overlooked your message, it's very nice that the setting is now persistent! Thanks for doing this. I think a little banner would go a long way for n00bs under Mac.

that-ben avatar Nov 12 '23 21:11 that-ben

As a Mac user by default and someone who has been annoyed by this Cmd- behaviour, can i vote for absolutely do not make swapping the keys a default. But it's probably a good idea to make the preference more visible.

drj11 avatar Feb 23 '24 13:02 drj11

@drj11 How do you use CMD-W in IM on a Mac without having the whole web browser closed if you don't swap CMD for CTRL?

that-ben avatar Feb 23 '24 15:02 that-ben

i don't. but i don't want them to be swapped by default.

drj11 avatar Feb 23 '24 17:02 drj11

I'm sorry, but I don't understand: If you don't use CMD shortcuts, then why don't you want the CMD and CTRL keys swapped by default? It's unusable on a Mac without them being swapped. What do you use CMD for if not for shortcuts?

that-ben avatar Feb 23 '24 17:02 that-ben

I think it's because i like the principle that Cmd- should be Cmd-. Yes, some of the Cmd-% commands might be stolen by the browser and never sent to the emulator, but they are not all stolen (or maybe they are for you, it's probably highly browser dependent).

I think it's easier (it's easier for me, for example) to understand that "Cmd- works but some commands are stolen by the browser" than no Cmd- works and i have no idea what key to press.

On objection i have to your "it's unusable on a Mac without them being swapped" is that that's exactly how i use it. And i wrote a HyperCard stack today.

drj11 avatar Feb 23 '24 18:02 drj11

The most problematic CMD shortcuts that cannot be used in InfiniteMac on a Mac are:

  1. CMD-Q (quits the whole web browser and InfiniteMac with it)
  2. CMD-W (closes the current web browser tab and InfiniteMac with it)
  3. CMD-S (tries to save the web page instead of any document potentially opened in InfiniteMac)
  4. CMD-O (tries to open a web page in the web browser, blurring the focus out of InfiniteMac)

What svcks is that those CMD shortcuts are the most useful under InfiniteMac and they can't be used without the CMD to CTRL swap.

that-ben avatar Feb 23 '24 18:02 that-ben

I just realised you can enable Sticky Keys in the emulated Mac (Control Panel > Easy Access in System 6) and then tap Cmd- followed by W (for example). It works. Haha.

I can't say i particularly recommend it, but it gives us options.

drj11 avatar Feb 24 '24 15:02 drj11

Ahhhhh yes! As 2 separate key strokes, genius! 👍

that-ben avatar Feb 24 '24 15:02 that-ben