1
1
I am doing annotation work and the web interface is not user friendly at all. I would like to add my own keybinds to buttons like "clear current field" or "switch to a previous field" so I don't have to keep reaching for my mouse every few seconds. Is that possible and how can I do it? I have some HTML background and can identify the element that presses the button on the website, but don't know anything about scripts unfortunately.
It is a third party website. This is how it looks like:
The code for one of the buttons is this:
</button><button onclick="void(0);" class="t-Button " type="button" id="buttonClearField"><span class="t-Button-label">Clear Field</span></button><button onclick="void(0);" class="t-Button " type="button" id="btnSaveHeaderFields"><span class="t-Button-label">Save</span></button>
I want to be able to press a specific keybind (for example ctrl+A) instead of clicking on the buttons every time.
I got it going! I used the code from one of the answers here Is it possible to set keyboard shortcuts on a webpage? and it worked. Yay!
1Your question is unclear. Are you working on a third-party website? Can you show a screenshot and a concrete example of what you are trying to achieve? – slhck – 2019-11-27T08:58:09.393
1Normally
shift
+tab
will return the cursor to the previous element.CTRL
+A
will select all in the current field. You might want to consider something like AutoHotKey to write macros. – Burgi – 2019-11-27T09:31:36.620Sounds like something you’d solve with a browser extension. For example, if your browser is Firefox, you could install https://addons.mozilla.org/en-US/firefox/addon/shortcutkey2url and write a little JavaScript representing each button-click
– Jim Danner – 2019-11-27T09:52:22.273Got it working! See my edits. – Chris – 2019-11-27T18:34:49.457