Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Hotkeys.filter = function (event) {
const tagName = (event.target || event.srcElement).tagName;
Hotkeys.setScope(/^(INPUT|TEXTAREA|SELECT)$/.test(tagName) ? 'input' : 'other');
return true;
};
export default class ReactHotkeys extends Component {
hotkeys.filter = function (event) {
var tagName = (event.target || event.srcElement).tagName
hotkeys.setScope(
/^(INPUT|TEXTAREA|SELECT)$/.test(tagName) ? 'input' : 'other'
)
return true
}
case 'left':
case 'a':
if (player.paused) player.prevFrame();
break;
case 'shift+right':
case 'shift+d':
if (player.paused) player.lastFrame();
break;
case 'shift+left':
case 'shift+a':
if (player.paused) player.firstFrame();
break;
}
return false;
});
hotkeys.setScope('player');
return () => {
hotkeys.deleteScope('player');
window.removeEventListener('resize', resizeCanvas);
player.clearEvents();
player.close();
player.destroy();
};
}, []);