Currently I'm developing a LG webOS application (using Vue.js). Everything works fine, except the fact that when I press the back button on the remote, the back event does not fire. This causes that I'm forced to assign the function to go back to the previous page, to another button (which is not user friendly) instead of the normal return button.
(FYI: I'm using a webOS Signage display)
I've read the documentation about the history API and handling the back event (webOS Back Button) and tried the following, but none of what I tried works:
- Setting
disableBackHistoryAPI
to true inappinfo.json
and then manually catching the keydown event when the back button is pressed (keycode461
); - Setting
disableBackHistoryAPI
to false inappinfo.json
and then adding an eventlistener for thepopstate
event - Vice versa (cause you never know)
Even trying to catch the back button press event (so catching keycode 461
) doesn't work. The application recognizes all other keycodes, but pressing the back button simply doesn't do anything (fires no event). Anyone has any idea on this?
To be sure the problem is not per se application bound, I installed the following application Back Button Application. The same result: no back event.
Code to catch key event (logs all keycodes except 461
):
window.addEventListener('keydown', evt => {
evt = evt || window.event
console.log(evt.keyCode)
if (evt.keyCode === 461) {
router.go(-1)
}
})
The back button is being registered on the LG webOS emulator (v4.0). The framework I'm using as stated earlier, is Vue.js and I use Cordova Toast to compile my projects to LG webOS (and in the future to Samsung Tizen).
-- BOUNTY EXPIRED BUT STILL LOOKING FOR AN ANSWER --