Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate.google tooltip: Window movement instead of expected behavior #2

Closed
Martii opened this issue Oct 4, 2015 · 10 comments
Closed

Comments

@Martii
Copy link

Martii commented Oct 4, 2015

Heyo. I thought I'd give this user script a whirl but found that if I follow the instructions of:

Select word or phrase with Alt key pressed - then hover over an icon below the selection.

... this moves the active window around the screen e.g. KDE has control of that modifier key and mouse drag operation.

Any ideas? I shouldn't have to modify my settings in KDE though. TIA :)

@trespassersW
Copy link
Owner

So, after text selection with Alt key, KDE starts dragging active window on any mouse movement? did I understand you correctly?

@Martii
Copy link
Author

Martii commented Oct 4, 2015

... after text selection with Alt key ...

The moment I press the Alt key and then try to select any text it drags the window instead.

@Martii
Copy link
Author

Martii commented Oct 4, 2015

So this is a way to get it working "out of the box" with KDE System Settings:

  1. Open this...
    kdesettings1spotlight opt
  2. Goto this...
    kdesettings2spotlight opt
  3. Change to this...
    kdesettings3spotlight opt
    (Meta key is usually the ctrl key on PC's, or on Macintosh keyboards they can be different keys... they have the command key (⌘) and control key on classic keyboards. For example this:
    condensedmackybd opt)

Additionally this script is "out of the box" incompatible with https://addons.mozilla.org/addon/flashgot/ and needs the following change in FlashGot to work with your script "out of the box":

  1. Goto this...
    flashgot1spotlight opt
  2. Change to this...
    flashgot2spotlight opt

After your "out of the box" script can be activated with the above changes ... then I can change the modifier key to use Ctrl and Alt in your script and restore both KDE settings and FlashGots settings back to "out of the box":

  1. Translate this comment...
    translategoogletooltipspotlight opt

This raises a few questions perhaps with a few requests for enhancement:

  • Is there an easy way to change to "Ctrl" and "Alt" e.g. bring up just that user interface on fresh installs of your script without having to use a modifier key?
  • Does this user script only translate one sentence at a time?

@trespassersW
Copy link
Owner

I wrote this just before I read your last post ::
I'd suggest the following:

  • Alt-double-click any word in text;
    the word should be selected and script's icon should appear;
  • if so, hover over it and, in options dialog, alter these check-boxes:
  • Use with: ☑ Ctrl ☐ Alt;
  • press save
  • thereafter the script will run on ctrl-select combination.

Does this user script only translate one sentence at a time?

That's Google who stops translation when it detects the end of sentence

Is there an easy way to change to "Ctrl" and "Alt"

Yes, I thought about it. Probably , it is necessary to add an item called 'translate.google options' into Greasemonkey's 'User Script Commands' menu.

@Martii
Copy link
Author

Martii commented Oct 4, 2015

Alt-double-click any word in text; the word should be selected and script's icon should appear

Looks like KDE is early binding on keyboard scan codes... so this possibility doesn't work at this time.

That's Google who stops translation when it detects the end of sentence

Well that bites. ;) :) ... EDIT: still a very nice script even with some hurdles.

'translate.google options' into Greasemonkey's 'User Script Commands' menu

That's about all I can think of myself since this script runs anywhere. It is difficult to find a common place in all websites user interface to put something like that. Not sure how you feel about floating preferences on by default "out of the box".

Thanks for your assistance/ears/eyes! :)

@trespassersW
Copy link
Owner

That's Google who stops translation when it detects the end of sentence

No, I was wrong. Now fixed.
Plus, I have added GM_menu item.

@Martii
Copy link
Author

Martii commented Oct 17, 2015

Goes eagerly to try it out :)

@Martii
Copy link
Author

Martii commented Oct 17, 2015

WOW! Very nice. Thank you! :) If I could rate your script higher, legally and ethically, I would! Nice work!

@Martii
Copy link
Author

Martii commented Oct 18, 2015

Retested on clean and well used profiles with:

Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 SeaMonkey/2.38 (moz 64 bit build) with GM Port
Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0 (distro 64 bit build) with GM

.... and everything is awesome... closing as you made life a lot easier for new installers with KDE. :) Thanks again and keep up the great work.

@Martii Martii closed this as completed Oct 18, 2015
@trespassersW
Copy link
Owner

Thank you Marty for your gentle review.
I'll be trying to maintain my modest script alive as long as I can..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants