-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Have a shortcut for “Read aloud selected text” #354
Comments
The behavior of the right-click context menu is a bit special. When you right click on the selection, the browser grabs the selected text and hands it directly to our context-menu event handler to read aloud. This is different from the other activation methods, which has to inject code into the page to grab the selected text. For this reason, we can't make a keyboard shortcut that replicate the exact equivalent behavior. Our keyboard handler will hvae to inject code to grab the text. But the "Play/Pause" and "Activate the extension" shortcuts are already doing that. Now since you don't want to popup to appear, you are left with the "Play/Pause" method. Your issue is you want the shortcut to start reading anew instead of pausing. Unfortunately Chrome only allows maximum 4 keyboard shortcuts. We cannot add another one without removing something. A workaround you can use right now is to press the Stop shortcut first, and then the Play/Pause shortcut. But this leads me to this train of thought. Maybe we can change the "Play/Pause" shortcut to just "Play", and make it always play anew. Then change the "Stop" shortcut to "Pause/Resume". After all, the user doesn't care about the distinction between pause and stop. Let me think more about this. |
Oh that explains why most extensions I see only have that many shortcuts. However, there're also many other plugins that allow more than 4 shortcuts (uBlock Origin — 7, Global Speed — 16), Tweaks for YouTube — ~ 20) My current work around is exactly as you said — to use Stop and then Play. Your proposal to change around these shortcuts make sense to me. If there's difficulty choosing what functions to give to a shortcut, I'd recommend you to look at Global Speed. I really like how it allows users to really deeply customize its shortcuts. The work around though doesn't work with selected text from pages such as https://www.autohotkey.com/docs/v2/Program.htm. But right click → Read aloud selected text work. Btw, I have a somewhat related request: Is there a way to for the plugin to read aloud the clipboard content? I'm thinking if I can be in any app, copy text, and then use a global shortcut to have this extension read that block of text aloud. Let me know if I should make a separate feature request. This would also help with reading selected text from the autohokey page above (select text → copy → read instead of right click and select the Read aloud option). Thank you! |
Ah thank you, I had the wrong assumption about the 4-shortcut limits. So we can have as many shortcuts defined as we want, but only 4 active at any one time, I suppose. I'll see what shortcuts to add that makes sense.
On sites like autohotkey.com, the regular activation method is unable to grab the selected text because the selection is inside in iframe. Technically we could traverse all the frames and find which one has text selected, but if the frame is cross-domain, we won't be able to access it. In that case, only the right-click method will work. |
I've had 5 active shortcuts from an extension, so there can be more active shortcuts :D |
Ah, you're right. Users can set as many as they want. Indeed only 4 can be declared by the extension. |
@ken107 Per
Isn't there a possibility to implement this feature, at least on Firefox based, in order to create the "Read selected text" shortcut via keyboard handler to avoid the repetitive context menu items? Is it undoable? |
Currently, right clicking after selecting a piece of text brings up this option, which I really like and use a lot:
However, there is no equivalent of such function in the shortcut list:
The “Activate the extension” and “Play/Pause” shortcuts does a similar job, but not exactly equivalent. (Extra details: if an existing reading is ongoing, “Play/Pause” shortcut play/pause that instead of starting a new one with the selected text. Plus, it doesn't work on all pages. The “Activate the extension” open the pop up every time and is quite distracting.)
I'm wondering if the “Play/Pause” shortcut can be made to have different functions depending on the situation:
Thanks a lot for making this awesome plugin!
The text was updated successfully, but these errors were encountered: