ericmckean / rikaikun

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

Enhancement: Press key to show the popup #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I don't need the popup to show up every time I run my mouse over Japanese 
texts, as I can read many of them and when it pops up every time it makes 
browsing difficult.  I thought about pressing keys when mouseover in order for 
the popup to show up. I have implemented this myself by editing the javascript 
every time there is an update. but I feel Google chrome started to get tough 
with edits or plugins not in the store.  So please add this option. It is not 
difficult.  For now it can be just a simple option enable ctrl+alt keys.  in 
future you could make it possible to set keys.

Here is what I do, although it doesn't give an option

Only two changes in rikaicontent.js
Line numbers based on 0.8.9

I comment line 322: 

        //if ((ev.altKey) || (ev.metaKey) || (ev.ctrlKey)) return; //mlk to register ctrl key

Then under these lines (around line 806):
    onMouseMove: function(ev) { rcxContent._onMouseMove(ev); },
    _onMouseMove: function(ev) {

Add these lines:
        //mlk to make popup only show up if ctrl & alt keys are pressed
        if (!ev.ctrlKey || !ev.altKey){ 
            this.clearHi();
            this.hidePopup();
            return;
        }

Thanks

Original issue reported on code.google.com by athar...@gmail.com on 10 Dec 2014 at 1:37