# Trigger annotation drawing is finished when 'ENTER' is hit

**URL:** <https://pdfjs.community/t/trigger-annotation-drawing-is-finished-when-enter-is-hit/140>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [July 16, 2020, 7:35am UTC](https://pdfjs.community/t/trigger-annotation-drawing-is-finished-when-enter-is-hit/140 "2020-07-16T07:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.patil](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kiran.patil](https://pdfjs.community/u/kiran.patil)\
**Post date:** [July 16, 2020, 7:35am UTC](https://pdfjs.community/t/trigger-annotation-drawing-is-finished-when-enter-is-hit/140/1 "2020-07-16T07:35:15Z")

</div>

I want to finish drawing annotation on ENTER and get annotationChanged action add called. Right now I have to double click to finish the drawing of annotation. So I want it from both ways either by double clicking or by ENTER.

How can I do that ? Is it possible in Pdfjsexpress!

---

<div class="post-metadata">

**Author:** ![zzhang](https://avatars.discourse-cdn.com/v4/letter/z/b9e5f3/32.png) [@zzhang](https://pdfjs.community/u/zzhang)\
**Post date:** [July 16, 2020, 6:16pm UTC](https://pdfjs.community/t/trigger-annotation-drawing-is-finished-when-enter-is-hit/140/2 "2020-07-16T18:16:29Z")

</div>

Hi,

You should be able to register your custom `enter` key in the viewer using [instance.hotkeys](https://pdfjs.express/api/WebViewerInstance.Hotkeys.html). Inside the callback you would want to call [polylineTool.mouseDoubleClick](https://pdfjs.express/api/Tools.PolylineCreateTool.html#mouseDoubleClick__anchor).

Thanks,  
Zhijie

---

<div class="post-metadata">

**Author:** ![zzhang](https://avatars.discourse-cdn.com/v4/letter/z/b9e5f3/32.png) [@zzhang](https://pdfjs.community/u/zzhang)\
**Post date:** [July 22, 2020, 3:19pm UTC](https://pdfjs.community/t/trigger-annotation-drawing-is-finished-when-enter-is-hit/140/3 "2020-07-22T15:19:42Z")

</div>


