Skip to content

Menu: Support number pad keyboard input #1732

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

Closed
wants to merge 1 commit into from

Conversation

fnagel
Copy link
Member

@fnagel fnagel commented Aug 17, 2016

Fixes #15031

@mention-bot
Copy link

@fnagel, thanks for your PR! By analyzing the annotation information on this pull request, we identified @jzaefferer, @apsdehal and @scottgonzalez to be potential reviewers

@fnagel
Copy link
Member Author

fnagel commented Aug 17, 2016

@arschmitz FYI

skip = false;

// Support number pad values
character = event.keyCode >= 96 && event.keyCode <= 105 ?
event.keyCode - 96 : String.fromCharCode( event.keyCode );
Copy link
Member

@arschmitz arschmitz Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this really matters in this case but when event.keyCode >= 96 && event.keyCode <= 105 we get a number here and when it's less we get a string. Do we want to force character to always be a string for consistency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was my thought

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So adding something like ( event.keyCode - 9 ).toString(); would be suitable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, that'd be fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@fnagel fnagel force-pushed the menu-selectmenu-numpad branch from 04a168f to 70617f1 Compare August 20, 2016 12:48
@fnagel fnagel force-pushed the menu-selectmenu-numpad branch from 70617f1 to 1edd9a1 Compare August 21, 2016 11:28
@scottgonzalez
Copy link
Member

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants