qingxiang-jia / Anki Hotkey

// ==UserScript==
// @name         Anki Hotkey
// @namespace    http://qingxiang-jia.github.io/
// @version      0.1
// @description  Hotkeys for Anki Web, z-1st button, x-2nd button, n-3rd button, m-4th button
// @author       Qingxiang Jia
// @match        https://ankiweb.net/study/
// @grant        none
// ==/UserScript==

window.onkeyup = function(e) {
	console.log('keyup');
	console.log(e.which);
	if (e.which == 90) {
		document.getElementById('ease1').click();
	} else if (e.which == 88) {
		document.getElementById('ease2').click();
	} else if (e.which == 78) {
        document.getElementById('ease3').click();
    } else if (e.which == 77) {
        document.getElementById('ease4').click();
    } else if (e.which == 8) {
        document.getElementById('ansbuta').click();
    }
};