We could use:
https://github.com/mozilla/pdf.js/blob/c3d08580627471432a6ad0b2fdb948df64126afa/src/display/api.js#L929

and look at bit 4.

The following pdf:
https://orimi.com/pdf-test.pdf
is not editable in neither Acrobat nor Edge nor Foxit and nor Okular.
if (!PDFViewerApplication.secondaryToolbar.isOpen) {
    return;
  }
  const appConfig = PDFViewerApplication.appConfig;
  if (
    PDFViewerApplication.pdfViewer.containsElement(evt.target) ||
    (appConfig.toolbar.container.contains(evt.target) &&
      evt.target !== appConfig.secondaryToolbar.toggleButton)
  ) {
    PDFViewerApplication.secondaryToolbar.close();
  }
}
function webViewerKeyDown(evt) {
  if (PDFViewerApplication.overlayManager.active) {
    return;
  }
  const { eventBus, pdfViewer } = PDFViewerApplication;
  const isViewerInPresentationMode = pdfViewer.isInPresentationMode;
  let handled = false,
    ensureViewerFocused = false;
  const cmd =
    (evt.ctrlKey ? 1 : 0) |
    (evt.altKey ? 2 : 0) |
    (evt.shiftKey ? 4 : 0) |
    (evt.metaKey ? 8 : 0);
  
  
  if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {
    
    switch (evt.keyCode) {