Page 1 of 1

[Alt]+[F1] to launch url or websearch on keyword

Posted: Tue Jul 30, 2013 10:53 pm
by blueznl
A long time ago far far away... oh wait. That's a different forum :-)

Some time ago I wrote a little tool CodeCaddy, yet these days the PB IDE seems to have made most of it superfluous. Yet there's one new feature I've been playing around with which I miss in the PB IDE.

I would like to be able to press ALT+F1 on any word inside the IDE, which then launches an external search, depending on the nature of the keyword.

For example:

1. If the word under the cursor is an URL (http://www.... or http://....) I would like a browser to open with that page.

2. If the word under the cursor is ending on an underscore, then launch a number of searches for that word MINUS the underscore, it's a great way to deal with WinAPI. In my setup I use the following parameters for the search:

http://google.com/search?q=%keyword%
http://www.google.nl/codesearch?q=%keyw ... earch+Code
http://google.com/search?q=site:purearea.net+%keyword%_
http://google.com/search?q=site:forums. ... %keyword%_
http://google.com/search?q=site:msdn.mi ... y+%keyword%

3. Otherwise, launch a search for the keyword.

http://google.com/search?q=%keyword%
http://google.com/search?q=site:purearea.net+%keyword%
http://google.com/search?q=site:forums. ... h+%keyword%
http://google.com/search?q=site:www.pur ... n+%keyword%

I'll upload the latest version of CodeCaddy in a moment to show what I mean.

Re: [Alt]+[F1] to launch url or websearch on keyword

Posted: Tue Jul 30, 2013 11:59 pm
by Bisonte
there is an external tool at german forum from chi since 2009...

Re: [Alt]+[F1] to launch url or websearch on keyword

Posted: Wed Jul 31, 2013 12:10 am
by blueznl
Bisonte wrote:there is an external tool at german forum from chi since 2009...
I think CodeCaddy dates back to 2005 or so :-) but the thing is: I'd like to have this as part of the PB IDE instead of an external tool. Nothing important or urgent, just nice to have.

Re: [Alt]+[F1] to launch url or websearch on keyword

Posted: Wed Jul 31, 2013 5:55 am
by Danilo
blueznl wrote:I would like to be able to press ALT+F1 on any word inside the IDE, which then launches an external search, depending on the nature of the keyword.
I am using ALT+F1 for API search (On Windows: [Editor Tool] VS2010 Help Integration, on Mac OS X: PB IDE Tool: Dash Mac OS X API help starter),
and other guys use other tools for this already. I would like to let this be like it always was, as there already exist many different help add-ons.

There are also more search engines available, and not everybody would like integration of google search into the IDE.
You already did what you wanted to have with your CodeCaddy tool, so no need to force your own ALT+F1 thing to us. ;)

Re: [Alt]+[F1] to launch url or websearch on keyword

Posted: Thu Aug 01, 2013 9:53 pm
by Zebuddi123
Also this i wrote and use regular set as a tool, assign key combination, left "ctrl & ¬" (not symbol) easy for right handers

Code: Select all

Define ScintillaID.i = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
Define Position.i, Min.i, Max.i, Text.s

Position = SendMessage_(ScintillaID, #SCI_GETCURRENTPOS, #Null, #Null)
Min = SendMessage_(ScintillaID, #SCI_WORDSTARTPOSITION, Position, #True)
Max = SendMessage_(ScintillaID, #SCI_WORDENDPOSITION, Position, #True)
For Position = Min To Max-1
	Text + Chr(SendMessage_(ScintillaID, #SCI_GETCHARAT, Position, #Null))
Next

If Right(Text,1)="_"
	Text=Left(Text,Len(Text)-1)
	RunProgram("http://social.msdn.microsoft.com/search/en-us/windows/desktop?query="+Text+Chr(38)+"Function Refinement=181")
ElseIf Left(Text,4)="#PB_"
	RunProgram("http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Fenglish+"+text)
ElseIf Left(Text,4)="#SCI"
	RunProgram("http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Fenglish+"+text)
ElseIf Left(Text,1)="#" And Mid(Text,2,2)<>"PB"
	Text=Mid(Text,2)
	RunProgram("http://social.msdn.microsoft.com/search/en-us/windows/desktop?query="+Text+Chr(38)+"Refinement=181")
Else
	RunProgram("http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.purebasic.fr%2Fenglish+"+text)
EndIf
End
Zebuddi. :D