Override standart actions for 'alt+click', 'ctrl+click', 'shift+click', etc

Hi Dmitry,

One way to create custom actions for click events is to use the addEventListener('leftMouseDown',...) API.

https://www.pdftron.com/api/web/Core.DocumentViewer.html#event:mouseLeftDown

An example of using this event with keyboard keys would look like this:

addEventListener('mouseLeftDown', (e)=> 
  if(e.ctrlKey) { 
    console.log('ctrl+click')
 } )

Here is a link to documentation on supported keyboard hotkeys:

https://www.pdftron.com/api/web/UI.Hotkeys.html#main

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com

1 Like