diff --git a/src/pyj/read_book/selection_bar.pyj b/src/pyj/read_book/selection_bar.pyj index 283f0ddea4..09ea829992 100644 --- a/src/pyj/read_book/selection_bar.pyj +++ b/src/pyj/read_book/selection_bar.pyj @@ -184,17 +184,17 @@ def all_actions(): if not all_actions.ans: all_actions.ans = { - 'copy': a('copy', _('Copy to clipboard'), 'copy_to_clipboard'), - 'lookup': a('library', _('Lookup/search selected word'), 'lookup'), - 'quick_highlight': a('highlight', _('Quick highlight in current style'), 'quick_highlight'), - 'highlight': a('highlight', _('Highlight selection'), 'create_highlight'), - 'search': a('search', _('Search for selection in the book'), 'book_search'), - 'bookmark': a('bookmark', _('Create a bookmark'), 'new_bookmark'), - 'search_net': a('global-search', _('Search for selection on the net'), 'internet_search'), - 'remove_highlight': a('trash', _('Remove this highlight'), 'remove_highlight', True), - 'clear': a('close', _('Clear selection'), 'clear_selection'), - 'speak': a('bullhorn', _('Read aloud'), 'speak_aloud'), - 'cite': a('reference-mode', _('Copy citation to clipboard'), 'cite'), + 'copy': a('copy', _('Copy to clipboard') + ' [Ctrl+c]', 'copy_to_clipboard'), + 'lookup': a('library', _('Lookup/search selected word') + ' [l]', 'lookup'), + 'quick_highlight': a('highlight', _('Quick highlight in current style') + ' [q]', 'quick_highlight'), + 'highlight': a('highlight', _('Highlight selection') + ' [h]', 'create_highlight'), + 'search': a('search', _('Search for selection in the book') + ' [f]', 'book_search'), + 'bookmark': a('bookmark', _('Create a bookmark') + ' [Ctrl+Alt+b]', 'new_bookmark'), + 'search_net': a('global-search', _('Search for selection on the net') + ' [s]', 'internet_search'), + 'remove_highlight': a('trash', _('Remove this highlight') + ' [Delete]', 'remove_highlight', True), + 'clear': a('close', _('Clear selection') + ' [Esc]', 'clear_selection'), + 'speak': a('bullhorn', _('Read aloud') + ' [t]', 'speak_aloud'), + 'cite': a('reference-mode', _('Copy citation to clipboard') + ' [x]', 'cite'), } qh = all_actions.ans.quick_highlight qh.icon_function = quick_highlight_icon.bind(None, qh.icon, qh.text) @@ -569,12 +569,32 @@ class SelectionBar: else: self.clear_selection() return - if ev.key is 'Delete' and self.state is WAITING: - self.remove_highlight() - return - if ev.key and ev.key.toLowerCase() is 'c' and ev.ctrlKey: - self.copy_to_clipboard() - return + if self.state is WAITING and not ev.ctrlKey and not ev.altKey and not ev.metaKey: + k = ev.key.toLowerCase() + if k is 'l': + self.lookup() + return + if k is 'q': + self.quick_highlight() + return + if k is 'h': + self.create_highlight() + return + if k is 'f': + self.book_search() + return + if k is 's': + self.internet_search() + return + if k is 't': + self.speak_aloud() + return + if k is 'x': + self.cite() + return + if k is 'Delete': + self.remove_highlight() + return sc_name = shortcut_for_key_event(ev, self.view.keyboard_shortcut_map) if not sc_name: return