Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Win7 64bit

Newest Firefox

Logitech g710+ keyboard with Logitech Gaming software

Right now, I have to

  1. Hover over an image

  2. right-click

  3. click on "save image as.."

  4. click "save" on the explorer save window (and potentially go to desktop)

I want to

  1. Hover over an image

  2. Press the G4 button on my g710+ keyboard

My first choice would be a Firefox extension, followed by a Lua script (that's what Logitech Gaming Software allows you to use), followed by AutoIt (I can code up simple things), followed by Autohotkey (never used it before and not installed).

In the latter three cases I obviously don't expect code from this Q&A board.

My intention is only to find out if there is a Firefox extension out there, or a simpler solution that I haven't thought of.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You will have to use The Key History in AutoHotKey to find out the ScanCode or keyname of your G4 key to launch this. Alternatively, you could map the G4 key internally to e.g. CtrlAltWinF12 and use the 2nd hotkey option.
The script will only execute when Firefox is active. It will Launch the rightClick menu, then send v, wait for the save as window and click Enter.

#SingleInstance Force
#installKeybdHook
#Persistent

#IfWinActive, ahk_class MozillaWindowClass
SC123::  ; or ^!#F12:: , select one of the two options
    Send,{RButton}
    Sleep, 30
    Send, v
    WinWaitActive, Save Image
    ControlSend, Button1, {Space} , Save Image
Return
#IfWinActive

Find the scancode:

Right Click on AutoHotKey Icon. Select Open, Type Ctrlk, hit G4, then F5 to refresh the page and see the scancode for G4 towards the bottom.


In AutoHotKey you can define hotkeys in multiple ways. Examples:

a::Send, Hello World!

When you press a it will send "Hello World" to whatever is active on your screen right then.

F12::Send, Hello World! 

Same but now for the F12 key

^!#F12::Send, Hello World! 

Same but now for the Ctrl+Alt+Win+F12 key combination

F1::Send, {F12}

Would remap your F1 key into the behaviour of the F12 key

SC058::Send, Test 

Uses ScanCode 058 (is the F12 key) to send "Test".

:*:ahk::AutoHotKey 

Expands abc into the word AutoHotKey.

In your situation, you will have to decide which hotkey combination will trigger the script.

Here is some documentation:
http://www.autohotkey.com/docs/KeyList.htm
http://www.autohotkey.com/docs/Hotkeys.htm

Oh, übrigens, the double :: separates the hotkey from the action and the ; is the comment separator. Grüsse.

share|improve this answer
    
Thanks for your answer. What does the line: "SC123:: ; or ^!#F12:: , select one of the two options" do? I have never seen autohotkey code before so I'm just curious what double colon means and the semicolon –  Wuschelbeutel Kartoffelhuhn Mar 1 '13 at 8:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.