diff --git a/manual/viewer.rst b/manual/viewer.rst index f0714778ab..ab7f25c315 100644 --- a/manual/viewer.rst +++ b/manual/viewer.rst @@ -111,7 +111,7 @@ highlight. You can add notes and change the color of the highlight. On a touch screen, long tap a word to select it and show the popup bar. Once in highlight mode you can change what text is selected, using touch screen friendly selection handles. Drag the handles to the top or bottom margins to scroll while selecting. -You can also hold the :kbd:`Shift` key and click to extend the selection, +You can also :kbd:`Shift+click` or :kbd:`right click` to extend the selection, particularly useful for multi-page selections. You can use the :guilabel:`Highlights` button in the viewer diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index a850404dde..3f2b42115f 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -245,6 +245,7 @@ class SelectionBar: container = self.container container.style.overflow = 'hidden' container.addEventListener('click', self.container_clicked, {'passive': False}) + container.addEventListener('contextmenu', self.container_context_menu_requested, {'passive': False}) container.addEventListener('mouseup', self.mouseup_on_container, {'passive': False}) container.addEventListener('mousemove', self.mousemove_on_container, {'passive': False}) container.addEventListener('touchmove', self.touchmove_on_container, {'passive': False}) @@ -475,6 +476,11 @@ class SelectionBar: self.position_in_handle.x = Math.round(ev.clientX - r.left) self.position_in_handle.y = Math.round(ev.clientY - r.top) + def container_context_menu_requested(self, ev): + pos = {'x': ev.clientX, 'y': ev.clientY} + map_to_iframe_coords(pos, get_margins()) + self.send_message('extend-to-point', pos=pos) + def container_clicked(self, ev): ev.stopPropagation(), ev.preventDefault() if self.state is EDITING: