mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Updated hotkey handling.
This commit is contained in:
@@ -189,16 +189,16 @@ function messageListener(request, sender, sendResponse) {
|
|||||||
//check for hotkey pressed
|
//check for hotkey pressed
|
||||||
document.onkeydown = function(e){
|
document.onkeydown = function(e){
|
||||||
e = e || window.event;
|
e = e || window.event;
|
||||||
var key = e.which || e.keyCode;
|
var key = e.key;
|
||||||
|
|
||||||
let video = document.getElementById("movie_player");
|
let video = document.getElementById("movie_player");
|
||||||
|
|
||||||
//is the video in focus, otherwise they could be typing a comment
|
//is the video in focus, otherwise they could be typing a comment
|
||||||
if (document.activeElement === video) {
|
if (document.activeElement === video) {
|
||||||
if(key == 186){
|
if(key == ';'){
|
||||||
//semicolon
|
//semicolon
|
||||||
startSponsorClicked();
|
startSponsorClicked();
|
||||||
} else if (key == 222) {
|
} else if (key == "'") {
|
||||||
//single quote
|
//single quote
|
||||||
submitSponsorTimes();
|
submitSponsorTimes();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user