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

Numberpad Keys #96

Open
ray73864 opened this issue Jul 16, 2019 · 5 comments
Open

Numberpad Keys #96

ray73864 opened this issue Jul 16, 2019 · 5 comments

Comments

@ray73864
Copy link

Is there anyway to define a key specific to one on the numberpad?

For instance, I would like to define a key to the asterisk on the number pad, or to the forward slash key on the numberpad, etc... that would work differently to the regular ones.

The current library I use which requires jQuery allows me to specify the numberpad ones as 'np'+key (eg. npminus, npplus, npasterisk, etc...).

@ray73864
Copy link
Author

I suppose the other question is, is there a way to add extra keys without having to modify the sourcecode?

Possibly using the keycode itself instead?

@jaywcjlove
Copy link
Owner

@ray73864 This idea can be. I have no way to achieve it for the time being. There is no way to debug. #89

@ray73864
Copy link
Author

Not sure if this helps, but this is the jQuery one I have been using for the last 7yrs, works fine, but i'm seeing a less and less need for jQuery so trying to move to more vanilla libraries.

https://github.com/jollytoad/jquery.keys/blob/ondemand/src/keys.core.js

You can see all the key definitions at the bottom of the file.

@ray73864
Copy link
Author

ray73864 commented Jul 17, 2019

I can use hotkeys('*', fn) for this for now.

/  = 111
*  = 106
-  = 109
+ = 107

Looks like there may be a difference between Firefox and other browsers with regards to the decimal point on the numpad, where FF defines it as 108 and other browsers define it as 110, but FF appears to do that with several other keys on the keyboard too.

@ishan576
Copy link

I just added Numpad keys to _modifer variable and seems to work for me. The user will have to specify both the keys while initializing the hotkey

`

"num_0": 96,
"num_1": 97,
"num_2": 98,
"num_3": 99,
"num_4": 100,
"num_5": 101,
"num_6": 102,
"num_7": 103,
"num_8": 104,
"num_9": 105,
"num_multiply": 106,
"num_add": 107,
"num_enter": 108,
"num_subtract": 109,
"num_decimal": 110,
"num_divide": 111,`

Usage:
hotkeys('-,=,1,2,num_subtract,num_add,num_1,num_2', 'numpadScope');

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

No branches or pull requests

3 participants