Skip to content

Add charCode method binding to KeyboardEvent #56

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

Merged
merged 1 commit into from
Oct 8, 2014

Conversation

l15k4
Copy link
Contributor

@l15k4 l15k4 commented Oct 8, 2014

The thing is, that even though keypress event is to be deprecated in favor of beforeinput, it's still in far future.

Currently there is no way to get hold of keypress event unicode value in Gecko based browsers where you can find it with certainty in charCode only. (based on my todays investigations).

For further reading, please see this google groups thread

@sjrd
Copy link
Member

sjrd commented Oct 8, 2014

Should we make that a js.UndefOr[Int], since it's only there in some browsers?

@l15k4
Copy link
Contributor Author

l15k4 commented Oct 8, 2014

From my experience it's in all browsers. Possibly with 0 value in case of keyup/keydown... Imho all browsers have it present and pass it 0 in cases it doesn't represent a unicode value.

@sjrd
Copy link
Member

sjrd commented Oct 8, 2014

LGTM OK.

sjrd added a commit that referenced this pull request Oct 8, 2014
Add charCode method binding to KeyboardEvent
@sjrd sjrd merged commit 6d773bb into scala-js:master Oct 8, 2014
Visbone pushed a commit to Visbone/scala-js-dom that referenced this pull request Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants