7

One thing I like about Google Desktop is you can configure it so that when you press Ctrl,Ctrl, it will bring up a dialog that looks like this:

Input box widget

The dialog will have focus and I can type in there, press enter, and then it will open a new tab in my default browser using the contents of the text box.

For instance; this allows me to type
Ctrl,Ctrl, foo, Enter
and it will open up this url: https://www.google.com/#q=foo

Is there a way to do this in Windows? Failing that, is there a tool that will work like this?

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
Daniel Kaplan
  • 579
  • 8
  • 23

5 Answers5

6

It's possible to do this with a script for AutoHotkey (Windows automation software). Just open notepad, paste the code below and save it with the .ahk file extension. I could only test it on Windows 7 though. But it opens the search URL on a new tab as expected. The search dialog box looks like this:

this

global MySearch
Gui, Margin, 9, 10
Gui, Font, s12
Gui, Add, Edit, vMySearch w400 -WantReturn
Gui, Font, c999999 s7
Gui, Add, Text, Y+3, Press <ctrl> twice to hide/show.

GuiEscape: 
    Gui, Hide

#ifWinActive Google Search 
NumpadEnter::
Enter::
    submitSearch()
    return
#IfWinActive

Ctrl::
    KeyWait, Ctrl
    KeyWait, Ctrl, D, T0.12
    if ErrorLevel = 0 
    {
        if WinActive("Google Search")
            Gui, Hide
        else
            Gui, Show,, Google Search
    }
    return

submitSearch(){
    Gui, Submit
    searchURL := "https://www.google.com/search?q=" . urlEncode(MySearch) 
    Run, %searchURL%
    GuiControl,, MySearch
}

urlEncode(url){
    VarSetCapacity(Var,StrPut(url,"UTF-8"),0),StrPut(url,&Var,"UTF-8")
    While Code:=NumGet(Var,A_Index-1,"UChar")
    Res.=(Chr:=Chr(Code))~="[0-9A-Za-z]"?Chr:Format("%{:02X}",Code)
    return,Res  
}
andromeda947
  • 384
  • 2
  • 10
  • +1: it works fine. Is it possible to get [Google Search Autocomplete](https://support.google.com/websearch/answer/106230?hl=en) in a dropdown box? – Andriy Tylychko Sep 25 '16 at 20:23
  • any idea why it opens empty google result when `#` symbol is used in search query? – Andriy Tylychko Sep 25 '16 at 22:30
  • 1
    Autocomplete would be too complex for me right now. But I edited the script to fix the # issue. – andromeda947 Sep 26 '16 at 18:29
  • 1
    I was looking for the same functionality from long time; your AutoHotKey script is serving the purpose without bells & Whistles. Thank you – Rap Sep 05 '18 at 05:53
2

What you could do is create a keyboard shortcut (without using any software!) to launch Chrome. Once you do that, you can hit the shortcut and when Chrome opens, it shows up with its address bar highlighted. Just type and hit enter.

Basically your exact use-case, except no middle-man (just type directly into the browser).

I don't think ctrl+ctrl, specifically, is possible (due to left/right ctrls not being distinguished and just being control keys).


Should the link die you can create a keyboard shortcut (without third party software) by;

  • creating an ordinary shortcut (type chrome into your start menu, rightclick on the icon -> copy, then rightclick in some folder -> Paste shortcut)
  • go into the properties of the shortcut (rightclick -> properties), under the Shortcut tab there should be a Shortcut key field.
  • type a key combination and hit Ok. That's it (the shortcut file will need to exist for the keyboard shortcut to continue to work)

As a further note, it turns out the result in the startmenu search for chrome is a shortcut, so you can skip the first step and just go into the properties of the menu item to add the Key shortcut field.

Hashbrown
  • 2,782
  • 4
  • 32
  • 47
  • Did you use that feature? It's hard to explain how useful it is if you wasn't addicted to it. Unfortunately opening a new Chrome window is not an option. I used it very often, so this would lead to tons of opened chrome windows. It's bad as I usually try to group my tabs in different windows by some criteria. Plus other differences. – Andriy Tylychko Sep 24 '16 at 21:23
  • if you've already got chrome open and want the results as a new tab in a specific window then `Ctrl`+`T` is your friend – Hashbrown Sep 25 '16 at 05:36
1

It's possible to do something similar to this (among other things) with the Open Source software Launchy.

By default the shortcut to open the bar is Alt + Space (You can change this but I don't think ctrl, ctrl is possible...)

To google search you would type "google" TAB "foo" ENTER.

Burgi
  • 6,493
  • 14
  • 39
  • 52
dahston
  • 31
  • 4
  • Exactly what my suggestion would've been. A short google search led me to believe Ctrl Ctrl isn't possible, but it also offered a solution: http://www.deanhouseholder.com/projects/launchy-ctrlctrl/ – TacoV Sep 28 '16 at 13:33
0

I wrote a version in Python using Tkinter:

https://gist.github.com/marczellm/9bb3a39c14fdf5a28c47ff132307aff6

marczellm
  • 511
  • 1
  • 8
  • 16
0

Try FluentSearch - it does exactly that: you press Ctrl + Alt then start typing.

(Later Edit) You can even customize the hotkey to be Ctrl + Ctrl: enter image description here

marin
  • 101
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 11 '22 at 11:18
  • Sorry, but I'm looking for something that searches after typing `ctrl`, `ctrl`, not `ctrl` + `alt` – Daniel Kaplan Feb 11 '22 at 17:21
  • You can actually customize the hotkey to be Ctrl + Ctrl in Fluent Search, if that's really a showstopper for you. I'll update my comment with a screenshot. – marin Feb 12 '22 at 08:42