hypothesis / support-legacy

a place for tracking support-related work and projects
3 stars 0 forks source link

Using keyboard shortcut 'h' with PDF changes pointer to Hand Tool #201

Open mattdricker opened 3 years ago

mattdricker commented 3 years ago

Reported by user: https://app.hubspot.com/contacts/6291320/ticket/405369758/

Describe the bug When annotating a PDF, using the keyboard shortcut 'h' to create a highlight changes the pointer from the Text Selection Tool to the Hand Tool. This forces the user to manually change the pointer back to the Text Selection Tool to continue highlighting or annotating.

This only occurs using keyboard shortcut 'h'. Using 'a' does not alter the Text Selection Tool.

Note: This is most likely due to PDF.js also using the 'h' key for selecting the Hand Tool. The 's' key selects the Text Selection Tool.

To Reproduce Steps to reproduce the behavior:

  1. Open a PDF in browser
  2. Activate Hypothesis extension or bookmarklet
  3. Select text, and type 'h' to create a highlight
  4. Note that the pointer tool changed from Text Selection to Hand Tool

Expected behavior User should expect that the Text Selection Tool would remain unchanged after using 'h' to highlight.

Confirmed in Chrome 90 & Firefox 88, MacOS 11.3.1

mattdricker commented 3 years ago

Here's a list of built-in PDF.js keyboard shortcuts: https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-shortcuts

robertknight commented 3 years ago

It might be OK to use the same shortcut that PDF.js uses for another purpose because it only applies when there is a text selection. We'd need to make sure that the default PDF.js shortcut is not invoked in that case.

It would be good to consider the alternatives as well.

mkdir-washington-edu commented 3 years ago

Referenced here: https://github.com/hypothesis/product-backlog/issues/1202