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

[FEATURE] Function add keycode for SmartTV #156

Closed
tconns opened this issue Mar 19, 2019 · 4 comments
Closed

[FEATURE] Function add keycode for SmartTV #156

tconns opened this issue Mar 19, 2019 · 4 comments

Comments

@tconns
Copy link

tconns commented Mar 19, 2019

Is your feature request related to a problem? Please describe.
I'm working on a project on SmartTV using React-Hotkeys. Back key on webOS does not receive

Describe the solution you'd like
Add method to add KeyCode like mousetrap

Describe alternatives you've considered
Just open more self-defined uses of mouestrap as v1 version.

Additional context
The control keys on the remote have different codes. Example: webos: "461:" BackTV ", tizen:" 10009: "BackTV"

@greena13
Copy link
Owner

Hi @tconns, thanks for filing your issue.

I have no experience working with webOS, so you're going to have to help me out here. Could you please confirm you're referring to the addKeycodes method on mousetrap?

Could you also confirm in your examples that the KeyboardEvents have a code or keyCode of 461, and a key of "BackTV"?

@tconns
Copy link
Author

tconns commented Apr 22, 2019

Sorry for the late!

In v1, I used addKeycodes method on mousetrap, it works normally.
But in v2 version, addKeycode doesn't work, looks like mousetrap can't override listKeycode in library.

You can try the example of replacing the 'numlock' key name with the 'BackTV' key. Then call 'BackTV' to the handlers.

@tconns
Copy link
Author

tconns commented Apr 22, 2019

(Tizen) Mousetrap.addKeycodes({
10009: "BackTV",
10252: "PlayPauseTV",
412: "PrevTV",
415: "PlayTV",
417: "NextTV",
19: "PauseTV",
413: "StopTV"
});
(WebOS)Mousetrap.addKeycodes({
461: "BackTV",
412: "PrevTV",
415: "PlayTV",
417: "NextTV",
19: "PauseTV"
});
Can you add a method to add these keycode? Right now I am adding directly to the library's DictionaryKey but it still has some errors.

@greena13 greena13 changed the title Function add keycode for SmartTV [FEATURE] Function add keycode for SmartTV Jun 3, 2019
@greena13
Copy link
Owner

This feature is now available in v2.0.0-pre8.

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

2 participants