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

Back Button functionality? #58

Open
connorprice opened this issue Feb 24, 2023 · 4 comments
Open

Back Button functionality? #58

connorprice opened this issue Feb 24, 2023 · 4 comments

Comments

@connorprice
Copy link

I have a feeling I may already know the answer to this question after a perusal through all of the documentation but are there any links or methodology related to a back button for this library?

@Yaffle
Copy link

Yaffle commented Feb 27, 2023

you could listen for changes and call history.pushState, saving the state, and listen for popstate , is this what you want?

@connorprice
Copy link
Author

Thanks for responding. I should have been more specific with my question in hindsight. When I say "back button" I'm talking about the physical button on a remote control, like the one found for most Android TV devices. This library linked perfectly with the d-pad and the enter button for the remote that I had and I was wondering if there were any events or links to that back button.

@TheGuy2003
Copy link

Thanks for responding. I should have been more specific with my question in hindsight. When I say "back button" I'm talking about the physical button on a remote control, like the one found for most Android TV devices. This library linked perfectly with the d-pad and the enter button for the remote that I had and I was wondering if there were any events or links to that back button.

if you are using this for a browser based project then there is a small issue where not all keycodes from devices are passed back to the browser this means on some devices you could have limited functionality the best thing todo is test keycodes for diffrent devices the manifecturere should list them if they dont follow default android keycodes

i use this project in a browser basedoption and it does work perfect for what i need but i did find errors in the code passed back my self when it came to some android devices and the xbox browser where very few buttons do actually pass back the buttopn event by the keycode

@kosso
Copy link

kosso commented May 23, 2024

Depending in which platform you are using, you need to listen (onkeydown) for an event.keyCode of 4, 10009 (for Tizen) and 461 (for webOS), or an event.code of 'Back'. (Also, some platforms will send event.which for the .code, so you need to test for this too).

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

4 participants