Skip to content

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

2 participants