FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Build a Menu

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
Mavox
Newbie


Joined: 04 May 2009
Posts: 1

PostPosted: Mon May 04, 2009 6:45 pm    Post subject: Build a Menu Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group