Hello BA guys,
I am NooB in Blender world and fascinated by python plus BGE.
I have read a lot of thread in which you can open external file from BGE using os.startfile and/or os.system open
I have a requirement in which when I take the cursor over an object and then right mouse click on it then web page or html file should be opened.
This should happen only when I right click on the desired object.
I am able to open the web page using the following script
from bge import logic as l from bge import render as r import os cont = l.getCurrentController() own = cont.owner r.showMouse(1) over = cont.sensors["over"] rclick = cont.sensors["rclick"] if over.positive and rclick.positive: os.startfile("www.google.co.in")
with sensors “over” (mouse over and not mouse over any) and “rclick” added on the Cube object.
But my problem is that once the web page or file is opened and I come back to the game window and take the mouse over the Cube - the webpage is opened again evenif I have not right clicked on the cube.
Is there any way in which I can open webpage if I do right mouse click on a specific object?
I want different web pages to open when I click different objects present in a scene.
Your help is needed urgently. I have a deadline to catch.
I have attached the 2.63 rc1 version of file.
I want to achieve this in 2.49a and 2.62 both.
openUrl.blend (73.5 KB)