mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-22 02:18:45 -04:00
Merge pull request #15 from chirag64/master
Fixed unwanted keypress events when typing into input fields
This commit is contained in:
@@ -110,6 +110,9 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
// if lowercase letter pressed, check for uppercase key code
|
||||
var keyCode = String.fromCharCode(event.keyCode).toUpperCase().charCodeAt();
|
||||
|
||||
// Ignore keypress event if typing in an input box
|
||||
if (document.activeElement.nodeName === "INPUT" && document.activeElement.getAttribute("type") === "text") { return false; }
|
||||
|
||||
if (keyCode == rewindKeyCode) { runAction('rewind') }
|
||||
else if (keyCode == fasterKeyCode) { runAction('faster') }
|
||||
else if (keyCode == slowerKeyCode) { runAction('slower') }
|
||||
|
Reference in New Issue
Block a user