matt-m-o / YomiNinja

Open-source OCR and dictionary tool.
GNU General Public License v3.0
280 stars 6 forks source link

WebSocket/Clipboard settings #20

Open rampaa opened 9 months ago

rampaa commented 9 months ago

The main reason many people prefer WebSockets over the clipboard to transfer text from some application to another is because they want to avoid polluting the clipboard. But AFAICT YomiNinja currently sends the text to the clipboard and to the hard-coded WebSocket port and does not let us choose which we prefer. An option to let us choose if we want text to be copied to the clipboard or to the specified WebSocket or to both would be quite handy. It would be also better if we could specify which WebSocket port is used for sending the text, because the port YomiNinja tries to use might be already in-use by some other application and whatnot.

An option (and maybe a hotkey) to auto copy the hovered text would be quite useful for using YomiNinja with external tools. There's already Copy on hover option but it copies whole OCRed text, but what I need is copying the text starting from the mouse position. e.g., Suppose that the OCRed text is はい、カズマです。, if I hover , I want a way です。 to be automatically copied to the clipboard/WebSocket instead of the whole text. That way I can automatically look up the word through an external tool without selecting the part I want to look up again.

Copy text on click doesn't seem to work when Click-through mode is enabled, regardless of whether the React to clicks with click-through enabled option is on or off. Is this by-design?

matt-m-o commented 8 months ago

Thanks for the suggestions! Currently, there's no dedicated menu for the copying feature (and websocket), but I will add one in the upcoming updates. The global hotkey for copying the hovered text was introduced in v0.6.0 and will be included in the next public release. Your idea of copying text from the mouse position is great, and will certainly be implemented in future updates.

Regarding the "copy text on click" issue, I couldn't reproduce it on my end. It seems to work fine when the "React to clicks with click-through enabled" option is on. There might be a possibility of another application intercepting the mouse event. Let me know if you find any more details.

rampaa commented 8 months ago

there's no dedicated menu for the copying feature (and websocket), but I will add one in the upcoming updates

Thanks!

Your idea of copying text from the mouse position is great, and will certainly be implemented in future updates.

Thanks, eagerly waiting for its arrival!

The global hotkey for copying the hovered text was introduced in v0.6.0

Just to clarify, the hotkey I requested would copy the text starting from the mouse position, and I assume the hotkey introduced in v0.6.0 doesn't do that.

Regarding the "copy text on click" issue, I couldn't reproduce it on my end. It seems to work fine when the "React to clicks with click-through enabled" option is on.

It doesn't work for me if Click through mode is enabled. Even if I enable the React to clicks with click-through enabled option, game window itself reacts to the mouse left click and the text does not get copied. If there's any specific info I can provide please ask away.