In this example, it seems that the same issue is still occurring. I am trying to implement something very similar into my app and and it is doing they same thing. @seanhoots @fayewatson are there any other workarounds?
I’ve created a form but I am not able to assign “tab” shortcut to a button it goes only to input fields. I there any way to assign tab shortcut to a button?
Thanks for this plugin!
I have trouble identifying open keys, is there a list somewhere?
Because if I use keys used by Chrome on my mac, say cmd+S, my shortcut with the plugin works, but Chrome then also wants to save the page and its native shortcut remains active.
Isn’t there a way to override this on a specific page?
Hi @GammaMat
Apologies for the late reply.
You can try the following approach using JavaScript to capture specific key presses and prevent their default browser behavior.
<script>
document.addEventListener('keydown', function(event) {
// Prevent default browser shortcuts
if (event.ctrlKey || event.metaKey) {
switch (String.fromCharCode(event.which).toLowerCase()) {
case 's':
// Prevent Save (Ctrl+S / Cmd+S)
event.preventDefault();
break;
// Add other cases as needed
}
}
});
</script>
Hope this helps!
Best regards,
Zeroqode Support Team