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

Rename KeyCode::*Win to KeyCode::*Meta #3240

Closed
MrGVSV opened this issue Dec 2, 2021 · 13 comments
Closed

Rename KeyCode::*Win to KeyCode::*Meta #3240

MrGVSV opened this issue Dec 2, 2021 · 13 comments
Labels
C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled

Comments

@MrGVSV
Copy link
Member

MrGVSV commented Dec 2, 2021

What problem does this solve or what need does it fill?

The KeyCode's LWin and RWin can be somewhat confusing/difficult to find for us Mac users. They seem like they should only work for Windows-style keyboards.

What solution would you like?

Rename KeyCode::LWin and KeyCode::RWin with the more generic KeyCode::LMeta and KeyCode::RMeta.

@MrGVSV MrGVSV added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Dec 2, 2021
@adsick
Copy link
Contributor

adsick commented Dec 3, 2021

'Meta' feels foreign for Windows and Linux users and also note that there are a lot more people on Windows than on MacOS.
On Linux we sometimes refer to it as 'Super' key, but that is probably the rarest one.

Imho this key won't be used in most games and apps so no need to bother.

@bjorn3
Copy link
Contributor

bjorn3 commented Dec 3, 2021

What emacs calls the meta key is the alt key on most keyboards or option on apple keyboards. Same for vim.

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 3, 2021

On Linux we sometimes refer to it as 'Super' key, but that is probably the rarest one.

Super is another possibility. I've made apps in Electron and I think they use both.

Imho this key won't be used in most games and apps so no need to bother.

That's probably true. Although, shortcuts like Super+W might be handy for multi-window applications. Or Super+C to copy text. And things like that.

But if these are seen to be unlikely cases, then I suppose we could just stick with the *Win terminology.

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 3, 2021

What emacs calls the meta key is the alt key on most keyboards or option on apple keyboards. Same for vim.

Oh didn't know that. Maybe Meta isn't the best then? Super is now seeming like it might be the better option then, if we want to still change it.

Otherwise, like I said in my other comment, we can just leave this as is if the community doesn't see any merit in it currently.

@adsick
Copy link
Contributor

adsick commented Dec 3, 2021

how about SuperMetaWin?

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 3, 2021

how about SuperMetaWin?

This is the one! 😂

@bouncepaw
Copy link

Meta can and will confuse Emacs and Vim users. It happened to me, actually, in a different project.

Super is a good and classic choice.

The QMK keyboard firmware uses the word GUI for this key. LGUI and RGUI.

Win and Cmd are platform-specific choices and thus should be avoided.

@visualcode-t
Copy link

Is having an alias an option? The problem is most keyboards have a "Windows" key regardless of your OS. So, simply changing it from one to another only moves the confusion, it doesn't really solve anything.

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 4, 2021

Is having an alias an option?

While it could be nice (again, this is how Electron handles it I think), it could be an issue when matching the KeyCode. We'd probably have to write something like:

match keycode {
  KeyCode::LWin | KeyCode::LMeta => { /* Do something */ },
  // ...
}

So I think an alias might not be the proper solution.

The problem is most keyboards have a "Windows" key regardless of your OS. So, simply changing it from one to another only moves the confusion, it doesn't really solve anything.

Yeah, that's what I think it comes down to. Most people are either on Windows or using a keyboard with a Windows key. A change like this might not be favored by the majority then, even if it does help agnosticize the OS/hardware terminology.

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 4, 2021

Closing for now, as it seems a change to Meta or Super might cause more confusion.

@MrGVSV MrGVSV closed this as completed Dec 4, 2021
@adsick
Copy link
Contributor

adsick commented Dec 4, 2021

I guess we might just leave this discussion for now and make a poll on this topic in the future. I've did a small poll in my blog and people preferred Super to Meta and no one wanted Win. (only 14 people participated)

also thought of an idea that there are a lot of gamers on Windows, but the majority of developers are on Linux/MacOS which might be an interesting point to consider in this context.

@aloucks
Copy link
Contributor

aloucks commented Dec 4, 2021

Why not just add some documentation to LWin and RWin that describes what they map to on other platforms?

@MrGVSV
Copy link
Member Author

MrGVSV commented Dec 4, 2021

Why not just add some documentation to LWin and RWin that describes what they map to on other platforms?

This is an easy compromise for the time being and should at least help

bors bot pushed a commit that referenced this issue Dec 15, 2021
# Objective

`KeyCode::*Win` and `KeyCode::*Alt` might be confusing for some Mac users.

## Solution

Added some small documentation to clarify the mappings for those developing on a Mac.

## Additional Context

Related issue: #3240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled
Projects
None yet
Development

No branches or pull requests

6 participants