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

KeyboardEvent key property clarification on how to use ShiftKey modifier #33451

Open
kanban-study opened this issue May 6, 2024 · 0 comments
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@kanban-study
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

While the page does mention that what's being checked is the printed output, it was not clear to me that to get, for example, shift + b, I needed to check for a capital B. As in:

//looking for shift + b
if(e.shiftKey && e.key == 'b') {
  //does not work
}

if(e.key == 'B') {
  //works
}

//looking for just b
if(e.key == 'b') {
  //works
}

What did you expect to see?

More clarification on how to check for key combinations with modifiers. Adding an example would have been helpful 😢

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@kanban-study kanban-study added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 6, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant