How to add keyboard shortcuts to AWS Ground Truth labeler UI?

656 views Asked by At

I'm using AWS Sagemaker Ground Truth for a Custom Labeling Task that involves editing bounding boxes and their labels. Ground Truth's UI has built-in keyboard shortcuts for doing things like choosing the label for a box, but it seems to lack shortcuts for other built-in UI elements like "No adjustments needed" or the "Submit" button.

Is there a way to add such shortcuts? I've looked at the crowd-html-elements for customizing the appearance of the page, but can't find anything in there about keyboard shortcuts. It doesn't even look like crowd-button or crowd-icon-button support specifying a shortcut as an attribute.

1

There are 1 answers

1
eulberg On BEST ANSWER

Could try something like:

document.addEventListener('keydown', function(event) {
  if (event.shiftKey && event.keyCode === 13) {
    document.getElementsByTagName('crowd-bounding-box')[0].shadowRoot.getElementById('nothing-to-adjust').querySelector('label').click();
  }
});