tierrif / chat-utils

Minecraft Fabric client-side mod to ease chat message copying.
https://modrinth.com/mod/chatutils/
GNU Lesser General Public License v3.0
17 stars 6 forks source link

Change default hold key in Macs to command instead of control #27

Closed QarthO closed 11 months ago

QarthO commented 12 months ago

On the latest update you introduced an optional feature to use a copy key.

If you have Mod Menu installed, you can change the key which is great. But normally mods also include any keybinds in the default vanilla keybinds. Not sure if this is bug, or just needs to be implemented. But having all the hotkeys all in one place is super helpful fo the end user.

Dont think its relevant, but here's my setup:

Using MultiMC:

Mods:

Another side note thats moreso a QoL fix for the new hotkey. You have the default being Left Control. Mac users use the Command key instead of Control. Is there anyway you're able to have the mod check the OS, and set the default to Command instead of Left Control if the user is on Mac?

tierrif commented 12 months ago

This is not a bug, it's intentional. Keybinds registered under "controls" will conflict with other keybinds (e.g. if you set left ctrl as the copy keybind and have ctrl set for sprinting, you won't be able to sprint and chat-utils will take priority).

I'm afraid this is Minecraft behaviour that can't be circumvented without applying changes that could break other mods. This is the friendliest way I found to implement the keybind, which is a HUD-exclusive keybind.

If you have any suggestions though, please do make them!

About Mac users, I'd expect Minecraft to consider ctrl as cmd in Mac, but if that's not the case I can change the default keybind to something else instead of complicating things so much.

QarthO commented 12 months ago

Ah yes, that makes perfect sense!

Do you know if there's anyway to have the copy key option in the keybinds be grayed out or a msg/button that says change the keybind in mod menu?

And the mac cmd/ctrl issue isn't too big, cause Minecraft by default isn't mac friendly, so we can expect to have to switch things over to command. Would just be a nice QoL change.

tierrif commented 12 months ago

I just looked into it though, and even though I'm unfamiliar with Macs, they do have a control key, does it not work for you in this situation?

QarthO commented 12 months ago

yes the control key works! This would be just a QoL change. Basically use the command key in place of control for hotkeys. For example in windows CTRL+C is copy. However on a mac is CMD+C. Nearly all developers (not just Minecraft, any software) incorporate a CMDorCTRL key. Where when assigning keybinds on setup, will basically run a check, if os = mac use command, else use control.

Minecrat even did this. For example, when dropping a full item stack. In windows you press CTRL+Q, in mac you need to press CMD+Q. And this is natively done in Minecraft, mac users don't have to make this change.

(a fun tidbit tho, CMD+Q is macs ALT+F4... sooo clearly some oversight from mojang)

tierrif commented 12 months ago

In a coming version I will add this (or anyone who feels like contributing can add it too). In a nutshell what needs doing is very simple: In the configuration value declaration for the hold key, instead of immediately setting the default value to GLFW_KEY_LEFT_CONTROL, run an OS check and set it to GLFW_KEY_LEFT_COMMAND if it's Mac.