Skip to content

Instantly share code, notes, and snippets.

@jamezrin
Last active March 15, 2019 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamezrin/665030398aaea5e89b5da2840fc7a04e to your computer and use it in GitHub Desktop.
Save jamezrin/665030398aaea5e89b5da2840fc7a04e to your computer and use it in GitHub Desktop.
Control de preguntas en tests mediante las flechas de dirección
// ==UserScript==
// @name eTestWeb / Controles por Teclado
// @namespace https://jamezrin.name
// @version 0.2
// @description Control de preguntas en tests mediante las flechas de dirección
// @author jaime@jamezrin.name
// @match *://www.carnetcnae.com/*
// @grant all
// ==/UserScript==
(function() {
'use strict';
var btnAnterior = document.getElementById('ctl00_cphContenedor_btnAnterior'),
btnSiguiente = document.getElementById('ctl00_cphContenedor_btnSiguiente');
document.addEventListener("keydown", function(e) {
if (btnAnterior && e.keyCode === 37) {
btnAnterior.click();
} else if (btnSiguiente && e.keyCode === 39) {
btnSiguiente.click();
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment