First custom event

Just starting out? Need help? Post your questions and find answers here.
Drone
User
User
Posts: 28
Joined: Fri May 03, 2019 10:21 pm

Re: First custom event

Post by Drone »

Piero wrote: Tue Mar 10, 2026 1:05 am
coco2 wrote: Mon Mar 09, 2026 8:03 pm I'm trying to read the PureBasic help and I couldn't figure out what it meant
…but never forget the PDF help;)

How to Install the PureBasic Search Bookmarklet
Create a new Bookmark in your browser’s Bookmarks Bar
Right-click it on Bookmarks Bar and edit the details:
Name: Search PB
URL/Location: Copy and paste the code below entirely:

Code: Select all

javascript:(function(){
  var selected = document.getSelection().toString().trim();
  if (selected === "") {
    selected = prompt("No text selected.\nWhat would you like to search for on PureBasic sites?", "");
  }
  if (selected !== null && selected !== "") {
    window.open('https://www.google.com/search?q=site:purebasic.fr OR site:purebasic.com/documentation ' + encodeURIComponent(selected));
  }
})();
How to Use It
Highlight (select) any command or keyword(s) (like PB_Event_FirstCustomValue or thread mk-soft) on any webpage.
Click the Search PB bookmark in your toolbar; a new tab will open with Google results restricted to the PureBasic forums and official documentation.

Note: If you don’t highlight anything, a pop-up box will appear asking you to type your search term(s) manually.
 
Thank you. Works great.
Everything Should Be Made as Simple as Possible, But Not Simpler - Albert Einstein
coco2
Enthusiast
Enthusiast
Posts: 489
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: First custom event

Post by coco2 »

Which browser did it work for you? In Firefox it just tries to search for the code.
Drone
User
User
Posts: 28
Joined: Fri May 03, 2019 10:21 pm

Re: First custom event

Post by Drone »

coco2 wrote: Tue Mar 10, 2026 10:06 pm Which browser did it work for you? In Firefox it just tries to search for the code.
Hi
I use Firefox.

I did exactly as told :

1) How to Install the PureBasic Search Bookmarklet
2) How to Use It

and got a new tab that open with Google results restricted to the PureBasic forums and official documentation.

Did you paste all of the javascript correctly ? ...and in the right place : URL/Location ?
Everything Should Be Made as Simple as Possible, But Not Simpler - Albert Einstein
coco2
Enthusiast
Enthusiast
Posts: 489
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: First custom event

Post by coco2 »

That's weird, it worked the second time I tried it
Olli
Addict
Addict
Posts: 1311
Joined: Wed May 27, 2020 12:26 pm

Re: First custom event

Post by Olli »

About javaScript, you have a totally free, complete and pedagogic school here.

However, you are discussing out of topic, out of language also. If it is a game to waste the time of others, think the life stops the game to you, without forcoming. Think also there will be other persons will read this subject from the title.

@coco2

Did you read the source code described two times, and using custom event in the simplest way, for only one event ?

Did you see the two couple of functions for that ?

manual set / manual get
PostEvent() --> EventType()

automatical set on / automatical set off
BindEvent() --> UnbindEvent()
Post Reply