Adding to the previous answer.
I leave you a basic example, with the combination of keys "ctrl + a"
HTML
<div class="form-group">
<button type="submit" id="btn_principal" class="btn btn-success btn-flat">Guardar</button>
</div>
JS
document.addEventListener('keyup', event => {
// combinación de teclas ctrl + a
if (event.ctrlKey && event.keyCode === 65) {
document.getElementById("btn_principal").click();
}
}, false)
You can search the key codes in link
I also recommend you investigate the keyboard events, since there are several.
-
onkeydown : Corresponds to pressing a key and not releasing it.
-
onkeypress : Corresponds to the keystroke itself.
-
onkeyup : Corresponds to releasing a key that was pressed.
Source: link