mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
Keypress event changed to keydown. It allows to control the extension with different keyboard layouts.
This commit is contained in:
@@ -155,11 +155,10 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
|
||||
document.addEventListener('keypress', function(event) {
|
||||
// if lowercase letter pressed, check for uppercase key code
|
||||
var keyCode = String.fromCharCode(event.keyCode).toUpperCase().charCodeAt();
|
||||
document.addEventListener('keydown', function(event) {
|
||||
var keyCode = event.keyCode;
|
||||
|
||||
// Ignore keypress event if typing in an input box
|
||||
// Ignore keydown event if typing in an input box
|
||||
if ((document.activeElement.nodeName === 'INPUT'
|
||||
&& document.activeElement.getAttribute('type') === 'text')
|
||||
|| document.activeElement.isContentEditable) {
|
||||
|
Reference in New Issue
Block a user