Extension: Rooster HotKeys -> Modify keybindings for LingQ Reader

ROOSTER WEB EXTENSIONS CATALOGUE

ROOSTER HOTKEYS FOR LINGQ
Browser extensions to modify keyboard shortcuts for LingQ

TESTIMONIALS

ROOSTER HOTKEYS FOR LINGQ (PREMIUM)

INSTALL
Rooster Hotkeys Premium has been merged into Rooster Master LingQ Premium.

DEVELOPMENT NOTES
→ Unbinds keys that share the new binding.
→ Improved GUI design, colors and presentation.
→ Import/Export Keybinding configs. (Save binds between browsers/new updates)

UPCOMING

→ Key sequence binds (e.g 1st press text to speech, second press translate sentence etc…)
→ Automatic sequence binds (1 press does actions in a row with a user set time delay)
→ Sequence binding creation menu
→ More display updates

ROOSTER HOTKEYS FOR LINGQ (FREE)

LATEST PATCH

Details 1.33

VIDEO 1.15 | VIDEO 1.10

ADJUSTABLE KEYBINDS

"TTS on LingQ Card: ": “s”,
"Left LingQ: ": “ArrowLeft”,
"Right LingQ: ": “ArrowRight”,
"Next Blue LingQ: ": “b”,
"Definition Up: ": “ArrowUp”,
"Definition Down: ": “ArrowDown”,
"Choose Definition: ": “Enter”,
"Remove First Definition: ": “”, //New bind
"Remove Last Definition: ": “”, //New bind
"Choose Defin/Open Dict: ": “e”,
"Play Sentence Audio: ": “a”,
"Toggle Audio: ": “Space”,
"Check Dictionary: ": “d”,
"Add Tag: ": “t”,
"Focus text box: ": “r”, //New bind
"Font Size - : ": “-”,
"Font Size + : ": { key: “+”, shift: true },
"Create New LingQ: ": “h”,
"LingQ status 1: ": “1”,
"LingQ status 2: ": “2”,
"LingQ status 3: ": “3”,
"LingQ status 4: ": “4”,
"Ignore LingQ: ": “x”,
"Mark LingQ known: ": “k”,
"Toggle Lesson Translation: ": “”, //New bind
"Rewind Audio: ": { key: “x”, ctrl: true },
"Report word meaning: ": { key: “f”, shift: true },
"Translate Sentence: ": { key: “t”, shift: true },
"Previous Page: ": { key: “ArrowLeft”, shift: true },
"Next Page: ": { key: “ArrowRight”, shift: true },
"Open Popup: ": { key: " ", shift: true },
"Close Popup: ": “Escape”,
"Rewind Audio: ": { key: “<”, shift: true },
"Forward Audio: ": { key: “>”, shift: true },
"Open Editor: ": “”, //New bind
"Open Listen Mode: ": “”, //New bind
"Change Playback Speed: ": “”, //New bind
"Change Playback Speed X3: ": “”, //New bind
"Open Previous Lesson: ": “”, //New bind
"Open Next Lesson: ": “”, //New bind
"Remove Colours: ": “”, //New bind
"Remove Colours and Bolden Text: ": “”, //New bind
"Toggle Stats Menu: ": “”, // New bind
"Toggle Words Read Today: ": “”, //New bind
"Toggle Total Words Read: ", //New bind
"Toggle Sentence/Page View: ": “”, //New bind
"Toggle HOTKEYS Menu: ": {key: “~”, shift: true}, // New bind
"Copy Active Sentence: ": {key: “C”, shift: true}, //New bind
"Open Print Page: ": {key: “q”, ctrl: true}, //New bind
"Toggle Reader Settings: ": {key: “z”, ctrl: true}, New bind

FEATURES

→ PERSISTENCE (These keys stay bound until you reset them, update browser, clear localstorage or change browser)
→ Ability to use modifiers (Alt,Ctrl,Shift, Meta + a key)
→ EASY GUI MENU

PLANNED UPDATES

→ Ability to bind and use mouse keys
→ More binds (Let me know what needs to be included, new feature or existing)

INSTALL THIS SOFTWARE

FIREFOX | CHROME | MANUAL INSTALL

TROUBLESHOOTING GUIDE by JPP025

7 Likes

Thanks for your hard work. I will try that once it is approved. Your extensions are already making LingQ are a lot more useful to use.

3 Likes

This is awesome! I really appreciate this!

Just giving it a test right now, a couple little notes/ideas:

  • I don’t think it’s unbinding the previous keyboard shortcut when you apply the new keys. For example, set a custom keybind to “k” for move right. If you use the move right “k” key it will move you to the next lingq but it will also mark the word known since it’s the default bind for that action. The same thing happens for keys like “f” which bring up a dictionary. Using unbound keys works perfectly though, currently have “h” set to move left and “l” set to move right and it works great!

  • Using the focus text box shortcut with the keyboard shortcut “t” will focus the text box but it also adds a “t” character to the start of the definition for me so I have to backspace that character before typing anything else. When using this shortcut with words that already have a definition in place, I wonder if there’s any way to make it so it puts the cursor at the end of the current word in that box when you hit the key so you can add to the current definition or edit what’s there easily. Right now it drops your cursor/edit position at the start of the word.

  • 2 other really important keys for me are navigating the user-made definitions up and down (default binds to arrow up and arrow down) when you have the right hand panel open. I noticed in your video demo that you are using the pop up lingq creator, I typically use the long right hand bar you can open up with the button in the top right of the editor and I navigate the lingq’s up and down from there with the arrow keys. Ideally I want to rebind those to “j” and “k”.

Anyway, thank you so much for putting this together. This is going to make things so much better for me!

2 Likes

This seems like an oversight from me, i’ll look into it.

Another oversight… I’ll need to make it remove any characters if that is the keypress and also set to end of line.

on the list for next patch

You’re welcome.

Edit: → I fixed the duplication thing (k does 2 actions, will push it soon)
second edit: → Text box issue also fixed. now doesn’t put the keypress and goes end of line

2 Likes

ROOSTER HOTKEYS PATCH 1.11 & 1.12

1.11
→ I fixed the duplication keypress action (original action triggered)
→ Text box issue also fixed. now doesn’t put the keypress and goes end of line
→ Up and down bind added

@mhast You will need to press Reset binds to see the new options.

1.12
→ Fixed keydown in textbox for rebound keys
→ Buttons only go blue after clicking.

Live on Firefox, Source code available.

2 Likes

This is unbelievable, I just tested it and have all my custom binds set… it works so well! You made my week @roosterburton, honestly this makes such a difference.

With all those fixes and now that you’ve added the up and down control, I’m good to go!

I did notice one thing, when the text input box is selected you can’t type text that uses keys that are bound to custom shortcuts, like I have “asdf” and “hjkl” as bound keys for rating lingqs and moving around but when I go to type a word that has characters from “asdf” and “hjkl” nothing is entered into the definition box (other keys work though). I usually use definitions made by others and just edit them slightly so this isn’t a deal breaker for me right now. I can also just type out what I want somewhere else on my system and paste it into the field if I absolutely need to. I wanted to mention it so you are aware though!

Again, thanks for such quick work and being so responsive in putting this together, it’s much appreciated. Cheers!

2 Likes

Thanks for being my dummy tester! :rofl:

I’ll sort that text issue out in a minute and re-upload for you.

2 Likes

I will gladly test this as best as I can, this has made using the reader incredible haha. I just tested the new version and the text entry works perfectly, I can operate completely without touching the mouse now which is so awesome.

Like I said before, I’m totally happy with the way this addon is right now, no changes necessary. However, if you are looking to extend this addon a bit more, there’s a few more keyboard shortcuts that you may want to put in. Check this link https://defkey.com/lingq-2022-shortcuts

I think one of the more useful ones would be “Play Sentence Audio”, that’s the one that plays the original audio from imported videos/podcasts while in sentence view. There’s a few more on there that weren’t in the original link I sent in the other thread so it might be worth checking out if you want to add more options at some point in the future.

One last idea I had - a keyboard shortcut to remove all current set definitions on the selected word.

edit: or even just a key bind to remove the top most definition, that way you can just tap the key a few times and remove each one a time without using the mouse to click the x button - I wonder if the coding required for this is similar to how you set the “t” shortcut for selecting the definition typing box, instead of selecting the typing box, select the x button to delete the definition?

For example, if I have 3 different definitions saved on the current word I have selected - a single key to remove all 3 and then enter a new one or choose a different one from the list. At the moment if I want to remove the definitions I have to use the mouse to click the x button beside each. I’m guessing this would be really difficult to do since it’s not something that currently has an assigned keyboard shortcut… but that would be really useful to me if it’s not hard to set up at some point.

Anyway, thanks again! Cheers.

2 Likes

ROOSTER HOT KEYS 1.13 & 1.14 PATCH NOTES

→ New bindings

Full List

"TTS on LingQ Card: ": “s”,
"Left LingQ: ": “ArrowLeft”,
"Right LingQ: ": “ArrowRight”,
"Next Blue LingQ: ": “b”,
"Definition Up: ": “ArrowUp”,
"Definition Down: ": “ArrowDown”,
"Choose Definition: ": “Enter”,
"Choose Defin/Open Dict: ": “e”,
"Play Sentence Audio: ": “a”,
"Toggle Audio: ": “Space”,
"Check Dictionary: ": “d”,
"Add Tag: ": “t”,
"Focus text box: ": “r”,
"Font Size: ": “-”,
"Create New LingQ: ": “h”,
"LingQ status 1: ": “1”,
"LingQ status 2: ": “2”,
"LingQ status 3: ": “3”,
"LingQ status 4: ": “4”,
"Ignore LingQ: ": “x”,
"Mark LingQ known: ": “k”,
"Rewind Audio: ": { key: “x”, ctrl: true },
"Report word meaning: ": { key: “f”, shift: true },
"Translate Sentence: ": { key: “t”, shift: true },
"Previous Page: ": { key: “ArrowLeft”, shift: true },
"Next Page: ": { key: “ArrowRight”, shift: true },

→ Added keyboard modifiers (alt,ctrl,shift,meta)
→ 2 Column UI

Picture

There is a bit more too this, Ill have a look in future patch

1.14
→ Bug fixes for LingQ status and show translation

2 Likes

Legend! The new layout and options look great. I just gave it a test run, the shift + key for paging works and the sentence view audio playback shortcut works perfectly as well.

I noticed rebinding the rating 1-4 on LingQs isn’t working for me now on the “asdf” keys (or any rebinded keys for that matter - seems to stay assigned to the 1-4 keys).

I also noticed that binding a key for the sentence translation show/hide doesn’t seem to show the sentence translation in sentence view. Not sure if this is something just on my end, I did reset all my bindings and restart my browser after installing the new version but it still seems to be acting that way.

1 Like

Thanks for making this!

However, the extension isn’t working for me after installation, I’m not quite sure if something is blocking it, but it’s greyed out for me.

Permissions are enabled:

1 Like

Hi @Vardan_Yervadian

I don’t think it loads in the vocab URL, just the library or reader page.

@mhast

I’ll fix that issue now, I renamed it and forgot to change the setting.

@mhast → its fixed now

2 Likes

Ah, you’re correct, again thanks for the work here.

Edit: Odd image opacity issue, making it extremely difficult to read:

But of course, we’re still alpha testing this.

1 Like

@Vardan_Yervadian

Edit: Ah is ee you use 2 page mode, yes I didnt put a background on it, try put it somewhere with white background, like editor page maybe

2 Likes

No problem… I guess next update should impose a solid black background for legibility?

2 Likes

Sounds good! Black background white text. Need to let it bind my 16 mouse buttons too!

2 Likes

Just using it now, working exactly as I always wanted, now I can finally use LingQ reader one-handed. Thanks, your work should get integrated onto the core site.

edit: stray observation and not really important, but if you click ‘rooster hotkeys’ a second time after the tab is already open, it opens a duplicate and freezes the webpage.
I think the natural expecation would be to close the tab after clicking ‘rooster hotkeys’ again, since initially I didn’t see the close button at the bottom.

edit2: Seems keeping the old number hotkeys for lingQ’s isn’t working for me, as in pressing them does nothing.

edit3: As I guessed, adding new hotkeys (I just put in 7,8,9,0) for the LingQ status keys suddenly made the only 1,2,3,4 keyboard keys work (at the same time) again.

I’d also suggest entering a text saying ‘drag window’ on that section of the popup bar, just to make things clearer.

3 Likes

@Vardan_Yervadian

Try resetting the binds and starting again. Bindings are stored locally even if you disable the app they are still saved but not in use.

Rooster Hot Keys - Patch Notes 1.15 & 1.16

→ GUI Upgrade
→ Fixed the font size key

Picture

1.16 → Removed from editor page (wasn’t allowing key presses)

2 Likes

This works great now, the new dark background helps a lot. The keybind issues I was having are all solved on my end now and it’s working as expected. Thanks for the quick fixes - this addon is the best.

I look forward to the future updates and other addons you end up making. If you are ever able to somehow get that remove definition shortcut working I will be so grateful for that as well!

2 Likes

@mhast @Vardan_Yervadian

ROOSTER HOTKEYS PATCH 1.17

→ Improved Display
→ Remove First and Last Definitions (Full keyboard Lingqing!)

3 Likes