NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @namespace https://openuserjs.org/users/integralik // @name keyPressJob // @description Add event listeners for keyPress // @copyright 2019, integralik (https://openuserjs.org/users/integralik) // @license MIT // @version 0.0.1 // @include * // @grant none // ==/UserScript== // =OpenUserJs== // @author integralik // =OpenUserJs== function onKD(keyCode, ctrlKey, callback) { document.body.addEventListener('keydown', function(event) { if (event.keyCode == keyCode && event.ctrlKey == ctrlKey) { callback(); } }); } function onF1(text) { onKD(112, false, function() { alert(text); } } (function () { document.body.addEventListener('keydown', function(event) { if (event.keyCode == '112') { alert('Ctrl+M - Запустить "Обычное повторение" курса Lingust'); } if (event.keyCode == '77' && event.ctrlKey) { location.replace('https://decks.memrise.com/course/5488813/lingust/garden/classic_review/'); } }); //onKD('77', true, function() { alert('Работает?'}; ); })();