kidlearnit / rikaikun

Automatically exported from code.google.com/p/rikaikun
0 stars 0 forks source link

Highlighting messes with user highlighting ability a bit. #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enable rikaikun.
2. Hover over a translatable word.
3. try to highlight that word manually.

What is the expected output? What do you see instead?
Should start highlighting.
Instead you try to move the current highlight.

Original issue reported on code.google.com by melin...@gmail.com on 3 Jan 2010 at 7:00

GoogleCodeExporter commented 9 years ago

Original comment by melin...@gmail.com on 5 Jan 2010 at 7:49

GoogleCodeExporter commented 9 years ago
here's a patch to improve that (press ctrl just deactivate the highlighting, 
though 
the popup stays)

--- /cygdrive/d/dev/rikaikun/extension_0_8/rikaicontent.js  2010-01-26 
13:44:07.066033000 +0100
+++ /cygdrive/d/dev/rikaikun/mine/rikaicontent.js   2010-01-26 14:14:51.150350100 
+0100
@@ -332,7 +332,7 @@
    _onKeyDown: function(ev) {
 //     this.status("keyCode=" + ev.keyCode + ' charCode=' + ev.charCode + ' 
detail=' + ev.detail);

-       if ((ev.altKey) || (ev.metaKey) || (ev.ctrlKey)) return;
+       if ((ev.altKey) || (ev.metaKey)) return;
        if ((ev.shiftKey) && (ev.keyCode != 16)) return;
        if (this.keysDown[ev.keyCode]) return;
        if (!this.isVisible()) return;
@@ -341,6 +341,18 @@
        var i;

        switch (ev.keyCode) {
+       case 17:    //ctrl
+           //console.log("pressed control");
+           if (tdata.config.highlight=='yes') {
+               tdata.config.highlight='no';
+               rcxContent.clearHi();
+           } else {
+               tdata.config.highlight='yes';
+               //clear current selection (not rikaikun's)
+               //console.log(window.getSelection().toString());
+               window.getSelection().removeAllRanges();
+           }
+           break;
        case 16:    // shift
        case 13:    // enter
            this.showMode = (this.showMode + 1) % this.dictCount;

Original comment by markus.g...@gmail.com on 26 Jan 2010 at 1:23

GoogleCodeExporter commented 9 years ago
I've always found highlighting in Rikaichan and Rikaikun to be quite 
frustrating for
this reason (makes it impossible to copy-paste). My workaround is to disable
highlighting in Rikaichan/kun entirely. In Rikaikun: Right-click Rikai-kun 
button,
select Options, flip "Highlight Text" option to No.

Original comment by generi...@gmail.com on 15 Feb 2010 at 7:47

GoogleCodeExporter commented 9 years ago
Rikaichan handles this by deselecting on mousedown, so it doesn't prevent 
dragging a new selection.  It's not perfect, but it's a lot better.

This bug prevents leaving it on all the time, forcing me to turn it on and off 
all the time, since it breaks text selections badly.

Original comment by oldglenn...@gmail.com on 9 Mar 2011 at 12:29

GoogleCodeExporter commented 9 years ago
Fixed by r49.

Original comment by melin...@gmail.com on 17 Jan 2012 at 11:10