// ==UserScript== // @name Mturk Radio Keybinds // @namespace https://gist.github.com/Kadauchi // @version 1.0.2 // @description Keybinds to select radios // @author Kadauchi // @icon http://i.imgur.com/oGRQwPN.png // @include /^https://(www|s3)\.(mturkcontent|amazonaws)\.com/ // @grant GM_log // @require https://code.jquery.com/jquery-3.1.1.min.js // @downloadURL none // ==/UserScript== var autosubmit = false; function _rate (i) { $(':radio').eq(i).click(); if (autosubmit) { $(':submit').click(); } } $(document).keydown(function (e) { switch (e.which) { case 49: case 97: // 1, Numpad 1 _rate(0); break; case 50: case 98: // 2, Numpad 2 _rate(1); break; case 51: case 99: // 3, Numpad 3 _rate(2); break; case 52: case 100: // 4, Numpad 4 _rate(3); break; case 53: case 101: // 5, Numpad 5 _rate(4); break; case 13: // Enter $(':submit').click(); break; } }); window.focus();