FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Tutorial: A very simple script sample
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
SolusCado
Newbie


Joined: 02 Oct 2006
Posts: 9

PostPosted: Tue Mar 06, 2007 9:12 pm    Post subject: Reply with quote

Yeah; after I posted this script I noticed the missing semicolons and added them in (to no avail, as one would expect). As for clearing out the var if something other than a 2 is pressed... I will ultimately add support in for the entire numeric keypad/alphabet equivalent... I just don't want to add a bunch of code that already doesn't seem to work.

I guess I'll just keep trudging along - trying different things. Are there any other ways, within the context of Salling Clicker, to save a temporary value like this?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Mar 06, 2007 9:21 pm    Post subject: Reply with quote

As for saving temporary values, I think you're doing the right thing.

I'd start adding some debugging code. You may want to print out (use ShowMessage()) the value of lastKeyPressed when a new keystroke comes in.

- jonas

[quote="SolusCado"]Yeah; after I posted this script I noticed the missing semicolons and added them in (to no avail, as one would expect). As for clearing out the var if something other than a 2 is pressed... I will ultimately add support in for the entire numeric keypad/alphabet equivalent... I just don't want to add a bunch of code that already doesn't seem to work.

I guess I'll just keep trudging along - trying different things. Are there any other ways, within the context of Salling Clicker, to save a temporary value like this?[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SolusCado
Newbie


Joined: 02 Oct 2006
Posts: 9

PostPosted: Tue Mar 06, 2007 9:22 pm    Post subject: Reply with quote

:) I tried that already ... one of the first things I tried. I'll keep at it, and let you know what/if I find...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
koushiro
Newbie


Joined: 11 Mar 2007
Posts: 1

PostPosted: Sun Mar 11, 2007 5:37 am    Post subject: Reply with quote

Hi. How do script the 'E' button being pressed on the phone? All the other keys i specified seems to work except for this one. It just goes to the previous menu. Btw I'm using the stop-gap solution. Here's a snippet of code: [code:1]
function myKeypad_KeyDown(theScreen, theKey)
{

SendUnicodeKeystroke( theKey );

// Keep the keypad active
return true;
}[/code:1]
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Sun Mar 11, 2007 12:16 pm    Post subject: Reply with quote

The stop-gap will have a problem with qwerty-style keyboard. Sorry.

Best.
--
Jonas

[quote="koushiro"]Hi. How do script the 'E' button being pressed on the phone? All the other keys i specified seems to work except for this one. It just goes to the previous menu. Btw I'm using the stop-gap solution. Here's a snippet of code: [code:1]
function myKeypad_KeyDown(theScreen, theKey)
{

SendUnicodeKeystroke( theKey );

// Keep the keypad active
return true;
}[/code:1][/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Prorad
Newbie


Joined: 06 Jul 2008
Posts: 1

PostPosted: Sun Jul 06, 2008 11:54 am    Post subject: Reply with quote

hello, first post here.

I am trying to get the basic script working for foobar2000 under windows xp. Actually sending commands works flawlessly, but there is a little issue. Having used the script for a while (say a 10-20 keystrokes sent), i cannot get back to the Clicker main menu on the phone: neither the "menu" nor the "back" function works immediatly, but only after having it pressed a number of times (i guess it depends on the number of commands sent while using it...).

How should i fix it?

EDIT: Another issue i noticed is that when the phone(nokia 6630) is executing the script, the backlight is ALWAYS on; however if i get back to the menu, it behaves as usual.

The script is based on the one made by another user, however here it is:

[code:1]
// foobar remote control script
// by 009
var class_name = "{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}";
var foopath = "c:\\Programmi\\foobar2000\\"; // path of foobar2000
var objShell = new ActiveXObject("Shell.Application")

var helper = new ActiveXObject("SCHelper.SECHelper");

isRun();

function isRun()
{
if (helper.IsProcessRunning("foobar2000.exe")) {
launchWidget();
} else {
var launchQuestion = CreateQuestionDialog("launch_");
launchQuestion.textualContent = "vuoi aprire foobar2000?";
theTerminal.Push(launchQuestion);
}
}

function launch_OK(w)
{
objShell.ShellExecute(foopath + "foobar2000.exe", "", "", "", 1)
launchWidget();
}


function launchWidget()
{
var widget = CreateKeypadScreen( "myfoobar_" );
widget.title = "Foobar Remote Controler";
widget.CreateRow( "Foobar Remote Controler v1.01", scCenter, scClip, scMedium );
widget.CreateRow( "By 009@2007-03-23", scRight, scWrap, scSmall );
widget.CreateRow( "", scCenter, scWrap, scSmall );
widget.CreateRow( "Centrale, 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 );
widget.CreateRow( "1 -- show current track", scLeft, scWrap, scSmall );
widget.CreateRow( "2 -- porta foobar in primo piano", scLeft, scWrap, scSmall );
theTerminal.Push( widget );
}

function myfoobar_KeyDown(theScreen, theKey)
{
isRun();
if( theKey == "s" ) {
SendVirtualKeystroke( 0x43,false,false,false,true );
var hwnd = FindWindow( class_name, "" );
var title = GetWindowCaption( hwnd );
ShowMessage( title );
} else if( theKey == "v" ) {
SendVirtualKeystroke( 0x6D,false,false,false,true );
} else if( theKey == "^" ) {
SendVirtualKeystroke( 0x6B,false,false,false,true );
} else if( theKey == "<" ) {
SendVirtualKeystroke( 0x58,false,false,false,true );
var hwnd = FindWindow( class_name, "" );
var title = GetWindowCaption( hwnd );
ShowMessage( title );
} else if( theKey == ">" ) {
SendVirtualKeystroke( 0x56,false,false,false,true );
var hwnd = FindWindow( class_name, "" );
var title = GetWindowCaption( hwnd );
ShowMessage( title );
} else if( theKey == "1" ) {
var hwnd = FindWindow( class_name, "" );
var title = GetWindowCaption( hwnd );
ShowMessage( title );
} else if( theKey == "2" ) {
var hwnd = FindWindow( class_name, "" );
var title = GetWindowCaption( hwnd );
var isActive = ActivateWindow( hwnd )
}
//ShowMessage( theKey );
// Keep the keypad active
return true;
}[/code:1]

thanks
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 -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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