-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keyboard shortcut for last annotation #950
base: master
Are you sure you want to change the base?
Conversation
I saw that you added a new controller for this. The original idea was to just take the annotation with the highest ID and select it. This does not require a controller etc. |
Sorry, I thought that the annotation list could not be up-to-date at some point, but I was wrong. I reverted all my changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be this nitpicky about such a small change again but, well, that's my job 😁
Is there a specific reason why the shortcut is handled by the annotationCanvas/videoScreen? It could also be handled directly in the annotatorContainer/videoContainer. Then there is no need to pass and handle an extra event.
Also I'm ambivalent about Ctrl+l
. The l
shortcut is already associated with the attach/swap tool. While this action is also about "selecting something", it's not directly related to the tool. Maybe we find an unused key and can add the shortcut without modifier (Ctrl
)?
Finally, the new shortcut must be added to the manual.
lastAnnotation.selected = true; | ||
remainingAnnotations.map(a => a.selected = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use handleSelectAnnotation()
so there are not too many different places that handle selecting of annotations.
lastAnnotation.selected = true; | |
remainingAnnotations.map(a => a.selected = false); | |
this.handleSelectAnnotation(lastAnnotation); |
lastAnnotation.selected = true; | ||
remainingAnnotations.map(a => a.selected = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried this and it works? When an annotation is selected (e.g. in the sidebar) the tool should seek the video to the start of the annotation. In the videoContainer annotation.selected
is then set to this time. Same as above, it should work fine if you reuse selectAnnotations()
:
lastAnnotation.selected = true; | |
remainingAnnotations.map(a => a.selected = false); | |
this.selectAnnotations([lastAnnotation], [], lastAnnotation.startFrame); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! When I tested it, I created multiple annotations in the same frame, which is why I didn't notice that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you leave the second parameter empty on purpose? Because this causes the last annotation only to be selected but not to seek the video, if another annotation was already selected on the timeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I just wanted to avoid selectAnnotation()
because this can have unexpected side effects with attaching or swapping labels. You should use:
this.selectAnnotations([lastAnnotation], this.selectedAnnotations, lastAnnotation.startFrame);
Because all keyboard events are handled in these components and transfer the events to the parent components. So I just copied what was already there, but it is no problem to change that. |
Closes #499.