Hello. I’m trying to disable some of the annotation-related hotkeys, but instance.UI.hotkeys.off
doesn’t work for annotation hotkeys. I also try to disable the related tools, but it also doesn’t work, and the tools are still available when I use the hotkeys. In the same time disabling of all the hotkeys except annotation-related ones works as expected.
My code:
WebViewer(
{
...
},
this.viewer.nativeElement
).then((instance) => {
instance.UI.disableTools([
'ArrowCreateTool',
'FreeHandCreateTool',
'CalloutCreateTool',
'FreeTextCreateTool'
]);
instance.UI.hotkeys.off(instance.UI.hotkeys.Keys.COMMAND_SHIFT_EQUAL);
instance.UI.hotkeys.off(instance.UI.hotkeys.Keys.F);
instance.UI.hotkeys.off(instance.UI.hotkeys.Keys.T);
instance.UI.hotkeys.off(instance.UI.hotkeys.Keys.A);
instance.UI.hotkeys.off(instance.UI.hotkeys.Keys.C);
}
The effect of this code is that Cmd+Shift+= hotkey is indeed disabled, but I still can use ArrowCreateTool, FreeHandCreateTool, CalloutCreateTool, FreeTextCreateTool with the corresponding hotkeys.
pdfjs-express version is 8.7.1