Skip to content

Commit

Permalink
fix back action on Hisense TV
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylyzo committed Jan 11, 2023
1 parent 09b9088 commit f3a3c91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scripts/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ if (userAgent.toLowerCase().indexOf('xbox') !== -1) {
browser.tv = true;
}
browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null;
browser.hisense = userAgent.toLowerCase().includes('hisense');
browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || window.tizen != null;
browser.vidaa = userAgent.toLowerCase().includes('vidaa');
browser.web0s = isWeb0s();
browser.edgeUwp = browser.edge && (userAgent.toLowerCase().indexOf('msapphost') !== -1 || userAgent.toLowerCase().indexOf('webview') !== -1);

Expand Down
10 changes: 10 additions & 0 deletions src/scripts/keyboardNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @module components/input/keyboardnavigation
*/

import browser from './browser';
import inputManager from './inputManager';
import layoutManager from '../components/layoutManager';
import appSettings from './settings/appSettings';
Expand Down Expand Up @@ -120,6 +121,15 @@ export function enable() {
inputManager.handleCommand('back');
break;

// HACK: Hisense TV (VIDAA OS) uses Backspace for Back action
case 'Backspace':
if (browser.tv && browser.hisense && browser.vidaa) {
inputManager.handleCommand('back');
} else {
capture = false;
}
break;

case 'Escape':
if (layoutManager.tv) {
inputManager.handleCommand('back');
Expand Down

0 comments on commit f3a3c91

Please sign in to comment.