Можно ли получить ресурс из функции?

обработчик событий для события keyup документа выглядит как подходящее решение

// define a handler
function doc_keyUp(e) {

    // this would test for whichever key is 40 and the ctrl key at the same time
    if (e.ctrlKey && e.keyCode == 40) {
        // call your function to do the thing
        pauseSound();
    }
}
// register the handler 
document.addEventListener('keyup', doc_keyUp, false);
0
задан Alex Kravets 18 January 2019 в 16:12
поделиться