Dont allow navigation shortcuts in read aloud overlays

They are pointless as the selection is changed causing a scroll as words
are read
This commit is contained in:
Kovid Goyal 2023-10-24 13:39:31 +05:30
parent 8aa739985a
commit 2503f2427c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 0 additions and 8 deletions

View File

@ -1004,8 +1004,6 @@ class IframeBoss:
sel = window.getSelection()
sel.removeAllRanges()
self.send_message('tts', type='text-extracted', marked_text=marked_text, pos=data.pos)
elif data.type is 'trigger-shortcut':
self.on_handle_navigation_shortcut(data)
def mark_word_being_spoken(self, occurrence_number):
self.last_search_at = window.performance.now()
@ -1034,8 +1032,6 @@ class IframeBoss:
else:
par = smil_element_at(data.pos, self.smil_anchor_map, self.smil_par_list)
self.send_message('audio_ebook_message', type='start_play_at', par=par or None, anchor=data.anchor or None)
elif data.type is 'trigger_shortcut':
self.on_handle_navigation_shortcut(data)
else:
console.error(f'Unknown audio ebook message type from main: {data.type}')

View File

@ -226,8 +226,6 @@ class ReadAloud:
elif sc_name is 'quit':
self.hide()
ui_operations.quit()
elif sc_name in ('up', 'down', 'pageup', 'pagedown', 'left', 'right'):
self.send_message('trigger-shortcut', name=sc_name)
def handle_tts_event(self, which, data):
if which is 'mark':

View File

@ -329,8 +329,6 @@ class ReadAudioEbook:
self.hide()
elif sc_name is "quit":
self.hide()
elif sc_name in ("up", "down", "pageup", "pagedown", "left", "right"):
self.send_message("trigger_shortcut", name=sc_name)
def send_message(self, message_type, **kw):
self.view.iframe_wrapper.send_message("audio-ebook", type=message_type, **kw)