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

[missing] KeyboardEvent needs some TLC #17560

Closed
peter-ahe-google opened this issue Mar 18, 2014 · 3 comments
Closed

[missing] KeyboardEvent needs some TLC #17560

peter-ahe-google opened this issue Mar 18, 2014 · 3 comments
Labels
area-library closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@peter-ahe-google
Copy link
Contributor

KeyboardEvent contains these declarations (ignoring DOM_KEY_LOCATION_* and private declarations):

altGraphKey
altKey
charCode
ctrlKey
getModifierState
keyCode
keyLocation
location
metaKey
repeat
shiftKey

According to this program:

@MirrorsUsed(targets: 'KeyboardEvent')
import 'dart:mirrors';
import 'dart:html';

void main() {
  var list = reflectClass(KeyboardEvent).declarations.keys.map(MirrorSystem.getName).toList()..sort();
  print(list.join("\n"));
}

According to MDN (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent), the following attributes are deprecated or have been dropped:

char
charCode
keyCode

So let's remove those from the API and see what we're left with, grouped by purpose:

Modifiers:

  altGraphKey, altKey, ctrlKey, metaKey, shiftKey, getModifierState

Location:

  keyLocation, location

Automatically repeated key (key held down):

  repeat

This leaves us with an interface that allows us to determine:

* if a key was pressed.

* if a modifier was engaged when said key was pressed.

* if the key was on the left-hand side, right-hand side, or the numeric keypad.

* if it was the result of a key being held down.

The following is NOT possible to determine:

* What key was pressed.

* Does the key represent a printable character.

I'd say that something is really wrong if you cannot determine which key was pressed.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@efortuna
Copy link
Contributor

Set owner to @efortuna.

@alan-knight
Copy link
Contributor

I think that what this is asking for is to update the API to what's current, which includes currently missing attributes like "key".


Removed the owner.
Removed Type-Defect, Priority-Unassigned labels.
Added Type-Enhancement, Priority-Medium labels.
Changed the title to: "[missing] KeyboardEvent needs some TLC".

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-library closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants