Mavox Newbie
Joined: 04 May 2009 Posts: 1
|
Posted: Mon May 04, 2009 6:45 pm Post subject: Build a Menu |
|
|
Hello! I'm a new user, still experimenting with salling and I'm a big fan of GOM player. I've been trying to make a remote control for it and searching the forum i've been able to launch the app and use the keypad to the basic commands, but since my acer DX900 doesn't have a numerical keypad, i've been trying to make a menu to use some more functions, like full screen, open file, open directory, but i cannot find any tutorial about it. I've tried a few combinations, taken from other scripts, but no luck.
this is what i've done so far
[color=green]var gompath = "C:\\Program Files\\GRETECH\\GomPlayer\\"
var objShell = new ActiveXObject("Shell.Application")
var helper = new ActiveXObject("SCHelper.SECHelper");
isRun();
function isRun()
{
if (helper.IsProcessRunning("GOM.exe")) {
launchWidget();
} else {
var launchQuestion = CreateQuestionDialog("launch_");
launchQuestion.textualContent = "Open Gom Player?";
theTerminal.Push(launchQuestion);
}
}
function launch_OK(w)
{
objShell.ShellExecute(gompath + "GOM.exe", "", "", "", 1)
launchWidget();
}
function launchWidget()
{
var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "GOM Player";
widget.CreateRow( "GOM", scCenter, scClip, scLarge );
widget.CreateRow( "", scCenter, scWrap, scSmall );
widget.CreateRow( "Central, play/pause", scLeft, scWrap, scSmall );
widget.CreateRow( "^ -- volume up", scLeft, scWrap, scSmall );
widget.CreateRow( "v -- volume down", scLeft, scWrap, scSmall );
widget.CreateRow( "< -- previous", scLeft, scWrap, scSmall );
widget.CreateRow( "> -- next", scLeft, scWrap, scSmall );
theTerminal.Push( widget );
}
function mykeypad_KeyDown(theScreen, theKey)
{
isRun()
if( theKey == "s" ) {
// VK_MEDIA_PLAY_PAUSE
SendKeystroke( 0x20, false );
} else if( theKey == "v" ) {
// VK_DOWN
SendVirtualKeystroke( 0x28, false );
} else if( theKey == "^" ) {
// VK_UP
SendVirtualKeystroke( 0x26, false );
} else if( theKey == "<" ) {
// VK_LEFT
SendVirtualKeystroke( 0x25, false );
} else if( theKey == ">" ) {
// VK_RIGHT
SendVirtualKeystroke( 0x27, false );
}
// Keep the keypad active
return true;
}
function mykeypad_KeyRepeat( theScreen, theKey )
{
if( theKey == "<" ) {
// VK_LEFT
SendVirtualKeystroke( 0x49, false, true );
} else if( theKey == ">" ) {
// VK_RIGHT
SendVirtualKeystroke( 0x0D, false );
} else if( theKey == "u" )
keyRepeated = true;
}[/color]
Right now I'm using the KeyRepeat to open a new file and toggle between fullscreen /window mode. But it would look much better if I had a menu from which I could choose those options and other functions.
I've seen in some scripts the 'ValueUpdated(theScreen, theProperty' and the '[theScreen.selectedItem]'
i think it would be something like ....
function moreMenu_ValueUpdated(theScreen, theProperty)
{
try {
var uuid = moreMenuItems[theScreen.selectedItem];
if( uuid == "Quit" ) {
closer app;
} else if (uuid == "Open"){
SendVirtualKeystroke( 0x49, false, true );
} else if (uuid == "Fullscreen"){
SendVirtualKeystroke( 0x0D, false );
}
} catch( e ) {}
}[/color]
Would apreciate any help.
thank you |
|