Hi Wolf,
I don't think it's too difficult. From looking at the script it looks all that is required is the following changes <see below>
If the state change is triggered by setting the environmental variable from STATE=?? to STATE="AUTORUN" it should trigger the autorun.xml/autorun.js scripts.
Caviate: I have not programmed on the SONY but the syntax is easy enough to read and understand.
<<<<<<<<<<< applicationStart.xml
////// MAP THE KEY
<boolean key="0x27-hold" do="dolaunchAutoRun"/>
<<<< main.xml
////// THIS CODE IS THEN CALLED
<code>
<function id="dolaunchAutoRun">
this.setVariable("STATE", "AUTORUN");
// I don't think this is necessary the line above should
// trigger this call, but if it doesn't we call it
this.modelChange();
</function>
</code>
If that doesn't work we might have to add part of this code found in the autorun.xml
in the main.xml file
<code>
<function id="loadScript">
if (!this.hasOwnProperty('_scriptLoaded'))
this._scriptLoaded = false;
if (!this._scriptLoaded)
{
var path = kbook.autoRunRoot.path;
var index = path.lastIndexOf('/');
if (index > 0)
path = path.substring(0, index + 1);
this.driveroot = path.substring(0,2);
var target = this.AUTORUN_GROUP.AUTORUN;
target.driveroot = this.driveroot;
this.runJs(path+"autorun.js",target);
}
this._scriptLoaded = true;
</function>
</code>
<<<< main.xml
/////////////// Update modelChange to call the loadscript function
<function id="modelChanged">
....
case "AUTORUN":
this.loadScript();
this.AUTORUN_GROUP.show(true);
target = this.AUTORUN_GROUP.AUTORUN
break;
....
</function>
Last edited by =X=; 05-13-2008 at 05:00 PM.
Reason: omitted some code
|