LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading.
https://luteorg.github.io/lute-manual/
MIT License
492 stars 46 forks source link

Request: Keyboard shortcut to delete a term and keyboard shortcut to copy the entire page #495

Closed Inquisitor-Ignotorum closed 1 month ago

Inquisitor-Ignotorum commented 1 month ago

Configuration: Windows 10, Lute installed via pip

Hello.

Could we please have a keyboard shortcut to delete a term without having to open the term editing panel? It would be great, for example, if the user could hover the mouse cursor over a term, then press the keyboard shortcut (the "Delete" key may be a great fit), and then the term deletion dialogue could immediately appear, as if the user had clicked the "Delete" button of the term editing panel, thus saving the time necessary for the term editing panel to open and then close again and preserving the flow of the reading experience. I often import lists of translated terms to pre-populate the Lute database and to save time while reading (in order to not have to interrupt the pleasant flow of the reading process due to constant term lookups), and I frequently need to delete some of the terms (e.g. fictional character/place names which would likely never re-appear outside of that specific book) from those imported lists while reading due to preferring to exclude them from my database (I also prefer to exclude them from the "Ignored" terms).

It would also be great if there could be a keyboard shortcut to copy the contents of the entire page. While reading non-fiction books, I like copying text containing information that I want to remember later, and I then like pasting that text to ChatGPT in order to ask it to quiz me on that information and to help me make flashcards out of that information. The paragraph-copying keyboard shortcut "Shift+C" is very useful for accomplishing this, but when the entire page is full of useful information, it is necessary to copy everything paragraph-by-paragraph or to use the sidebar's "Translate page" command or "Edit current page" command and to then copy the page's text from there. To save time and energy, it would be useful to have a keyboard shortcut (perhaps "Ctrl+C" could work) to instantly copy the text of the entire page.

I am interested in learning your thoughts about this. It currently seems to me that the above are very specific situations where the two hotkeys could be useful, and those situations may not apply to other Lute users. However, I hope that the two keyboard shortcuts would help make the daily workflow of many Lute users faster and smoother, just like they would do to my daily workflow.

Thank you very much for your work. I use Lute every day and find it very beneficial.

jzohrab commented 1 month ago

Hey @Inquisitor-Ignotorum , thanks for the detail.

These both make sense to me. "delete" to delete a term is good.

For copying the full page, I'm not sure what a good shortcut is -- "c" copies the sentence, "shift + c" copies the paragraph -- maybe "shift + p" to copy the whole page. I'll add that, I guess, as a first pass.

Hard to say what is a good shortcut and won't get in peoples' way. There's an issue to make custom keys, #141 . In the meantime, these are fast tweaks. Thanks!

jzohrab commented 1 month ago

I'm implementing the custom shortcuts issue first, #141 , before I get to this one.

jzohrab commented 1 month ago

Hi @Inquisitor-Ignotorum -- a slight tweak to your issue: Rather than completely delete a term, I feel it's safer to return it to "unknown", which is how Lute currently handles new terms when reading anyway. For example, if I've added this term and added some data:

image

when I hit the key I mapped to "delete" the term, you can see that it's returned to light blue, but the term and its data still exist in the db:

image

This prevents accidental deletes and data loss, but still keeps the reading pane clear and should keep your brain clear, if that makes sense. (It's a bit cleaner/more fitting with the "Lute idea" (if that's a thing) to mark them as ignored, but that's ok, that's your preference). Cheers!

jzohrab commented 1 month ago

Added to develop, will be in next release. You'll have to choose your own shortcut for these to work. Thanks!

jzohrab commented 1 month ago

Launched in 3.5.7.