FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Wishlist

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


Joined: 01 Dec 2005
Posts: 6
Location: Marburg

PostPosted: Fri Dec 02, 2005 1:17 pm    Post subject: Wishlist Reply with quote

Ok, i tested 3.0.1.333 and built the first remote :). the system really rocks so far and because of the javascripting its not so difficult to create own things.

so my first "script" was a PCTV (Pinnacle) remote. Now i can hang out on my sofa and manage all things including tv recording, tv screenshots and so on. amazing!!!

but no software is perfect :) and so i have some inspirations / wishes for the future :)

a) The "My Clicker Scripts" dir -> It would be great if the path to this directory would be saved in the registry, so i could use the path within my scripts. this would ease the use of images and dedicated setting files etc. (which could be placed right into the script directory besides the xml and js file). a second advantage of that would be that users could change the location of their "My Clicker Scripts" directory (for example: I dont like if others programs create subdirectories in "My Files" without asking me. i would prefer a "Customs Scripts" in the Salling Clicker dir). something like "HKEY_LOCAL_MACHINE\SOFTWARE\Salling Software AB\WinClicker\CustomScriptsDir" would be great :)

b) maybe it just some kind of bug of my k750i, but while running a remote it just doesnt jump back into "Standby" again (backlight turned off -> save energy). i guess its connected with the <widget>_Update function, which constantly sends requests to the cell phone -> the celly thinks its in use and doesnt switch to power-save-mode.


Ok that are the two major things which bothered me within my first day of Clicker-Scripting :)

And two questions at the end:
1) how can i assure that a specific window is active? somehow the theTerminal.PopTo(<windowname>) seems not to work for me :-/.

2)how do i convert binary data (a REG_BINARY value) from the registry into plain text? i can just see b0 03 20 00 83 00 and so on. what can i do?
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Dec 02, 2005 2:36 pm    Post subject: Reply with quote

Hi. I'll address some of your questions:

a. From your script, you can get the path to the script's bundle directory by reading the property "resourcesPath". Check it out.

b. The backlight will turn off after 10 minutes of no user interaction.

1. PopTo() works, and is used in several of the standard scripts. What are you trying to do?

2. Not sure about this one, except the obivous solution of parsing the data.

Best.
--
Jonas

PS. Once you've made use of (1), perhaps you could post your script for others to enjoy? I'd link to it from the scripts page.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kyrd
Newbie


Joined: 01 Dec 2005
Posts: 6
Location: Marburg

PostPosted: Sat Dec 03, 2005 5:43 pm    Post subject: Reply with quote

thanks for answering so fast :)

1) PopTo - i want to "activate" a window, to send (virtual)keystrokes to it. for example, if i would like to close it: i send a ALT + F4, but if the window isnt activated another programm will be quited (the one which is currently active) ... not so nice :). I tried PopTo but somehow it doesnt worked out for me :(. Here's a script example (i modified the windows media player remote and added a Quit Menu entry to the "More" menu):

[code:1]var helper = new ActiveXObject("SCHelper.SECHelper");
if (helper.IsProcessRunning("wmplayer.exe"))
{
launchWidget();
}


function launchWidget() {
var quitQuestion = CreateQuestionDialog("quit_");
quitQuestion.textualContent = "Sure you want to quit the Media Player?";
theTerminal.Push(quitQuestion);
}

function quit_OK(w) {
ShowMessage("Windows Media Player", Stop);
theTerminal.PopTo("Windows Media Player");
SendVirtualKeystroke(0x73,false,false,true,false);
}[/code:1]

but this does only work if the WMP window is really active :-/ (otherwise the currently active window will be closed).


2) binary data -> uhm yeah thats what i meant :) how do i parse that kind of data? *i am completly new to windows and binary stuff programming*. is there an easy js function?


b) backlight -> oh i see ... cool :) but would be great if the user could select this timeout value in his salling settings :)

a) perfect :) i gonna try that



and finally a new question: do you thing it might be possible to work with dynamic web contents? it would be great if i could use rss feeds to make them available on my clicker client. for example tv guides or websites news ... gosh that would be great :D. but i reckon thats more an issue of js not of clicker.
Back to top
View user's profile Send private message
bohrsatom
Newbie


Joined: 02 Dec 2005
Posts: 12

PostPosted: Wed Dec 07, 2005 8:33 pm    Post subject: Reply with quote

Perhaps a silly question, but what class is resourcesPath a property of?
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Wed Dec 07, 2005 8:40 pm    Post subject: Reply with quote

Not silly at all. From the script's perspective, it's just a global property. In reality it's a member of the IClicker interface (which is a hidden interface).

Does this help you?

Best.
--
Jonas

[quote="bohrsatom"]Perhaps a silly question, but what class is resourcesPath a property of?[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raducoc
Newbie


Joined: 06 Dec 2005
Posts: 11

PostPosted: Wed Dec 07, 2005 9:19 pm    Post subject: Reply with quote

For kyrd:

Please share your script! I want to make one for my DVB-T player software, but I dont know how. Thx in advice.
Back to top
View user's profile Send private message
kyrd
Newbie


Joined: 01 Dec 2005
Posts: 6
Location: Marburg

PostPosted: Fri Dec 09, 2005 12:15 pm    Post subject: Reply with quote

ok here it is. the resourcesPath property works fine :).

Whats missing here is:
- Volume Control: Function that handels repeating key press
- Channel Name: A function that reads the registry and parses the channel names (to display them on the cellphone display)
- PopTo doesnt work for me -> sometimes you have to activate the newly started application via the mouse pointing tool. after that you can send commands via the salling remote script.


heres the PCTV remote code:


[code:1]//SendVirtualKeystroke(
//[in] WORD code,
//[in, defaultvalue(FALSE)] VARIANT_BOOL shiftState,
//[in, defaultvalue(FALSE)] VARIANT_BOOL ctrlState,
//[in, defaultvalue(FALSE)] VARIANT_BOOL altState,
//[in, defaultvalue(FALSE)] VARIANT_BOOL winState );


var recordStartTime = null;


// Initialize more menu
var moreMenu = CreateListScreen( "moreMenu_");

var moreMenuItems = new Array();
moreMenuItems[0] = "Recording";
moreMenuItems[1] = "Fullscreen";
moreMenuItems[2] = "Screenshot";
moreMenuItems[3] = "Switch Input Signal";
moreMenuItems[4] = "Show Controls";
moreMenuItems[5] = "---";
moreMenuItems[6] = "Shutdown TV";

var moreMenuItemUUIDs = new Array();
moreMenuItemUUIDs[0] = "switchRecording";
moreMenuItemUUIDs[1] = "switchFullscreen";
moreMenuItemUUIDs[2] = "takeScreenshot";
moreMenuItemUUIDs[3] = "switchInputSignal";
moreMenuItemUUIDs[4] = "showHelp";
moreMenuItemUUIDs[5] = "";
moreMenuItemUUIDs[6] = "shutdownTV";


moreMenu.name = "More menu list";
moreMenu.title = "More functions";
moreMenu.selectedItem = 0;
moreMenu.itemLabels = moreMenuItems;

// FileSystemObject for use in this script
var fso = new ActiveXObject( "Scripting.FileSystemObject" );


var helper = new ActiveXObject("SCHelper.SECHelper");
if (helper.IsProcessRunning("vision.exe")) {
launchWidget();
} else {
var launchQuestion = CreateQuestionDialog("launch_");
launchQuestion.textualContent = "Launch PCTV Vision?";
theTerminal.Push(launchQuestion);
}

function launch_OK(w)
{
var PCTVPATH = null;
try {
var wsh = new ActiveXObject('WScript.Shell');
PCTVPATH = wsh.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Pinnacle Systems\\PCTV Stereo\\Main path");
} catch( e ) {}

if( PCTVPATH == null ) {
var widget = CreatePopupDialog( "" ); // not interested in callbacks
widget.textualContent = "Cannot find PCTV on your computer :-(.";
theTerminal.Push( widget );
exit();
}

var tv = new ActiveXObject("Shell.Application").ShellExecute( PCTVPATH+"\\Vision\\vision.exe", "" );
launchWidget();
}

function launchWidget()
{
var widget = CreateMediaplayerScreen( "mykeypad_" );
widget.title = "PCTV";
widget.name = "PCTV";

if( theTerminal.displaySize == scSmall ) {
tvStatus = widget.CreateRow("TV IS ON", scCenter, scClip, scSmall);
recordStatus = widget.CreateRow("", scCenter, scClip, scSmall);
} else if( theTerminal.displaySize == scMedium ) {
tvStatus = widget.CreateRow("TV IS ON", scCenter, scClip, scMedium);
recordStatus = widget.CreateRow("", scCenter, scClip, scMedium);
} else {
tvStatus = widget.CreateRow("TV IS ON", scCenter, scClip, scLarge);
recordStatus = widget.CreateRow("", scCenter, scScroll, scLarge);
}


var tfile = resourcesPath + "/pctv.jpg"
widget.image = tfile;

theTerminal.Push( widget );
}


function mykeypad_KeyUp( theScreen, theKey )
{
try {
if( theKey == "<" ) {
SendVirtualKeystroke(0x28,false,false,false);
} else if( theKey == ">" || theKey == "r") {
SendVirtualKeystroke(0x26,false,false,false);
} else if( theKey == "v" ) {
SendVirtualKeystroke(0x25,false,false,false);
} else if( theKey == "^" || theKey == "u") {
SendVirtualKeystroke(0x27,false,false,false);
} else if( theKey == "1" ) {
SendVirtualKeystroke(0x31,false,false,false);
} else if( theKey == "2" ) {
SendVirtualKeystroke(0x32,false,false,false);
} else if( theKey == "3" ) {
SendVirtualKeystroke(0x33,false,false,false);
} else if( theKey == "4" ) {
SendVirtualKeystroke(0x34,false,false,false);
} else if( theKey == "5" ) {
SendVirtualKeystroke(0x35,false,false,false);
} else if( theKey == "6" ) {
SendVirtualKeystroke(0x36,false,false,false);
} else if( theKey == "7" ) {
SendVirtualKeystroke(0x37,false,false,false);
} else if( theKey == "8" ) {
SendVirtualKeystroke(0x38,false,false,false);
} else if( theKey == "9" ) {
SendVirtualKeystroke(0x39,false,false,false);
} else if( theKey == "0" ) {
SendVirtualKeystroke(0x4D,false,true,false);
} else if( theKey == "f" ) {
theTerminal.Push(moreMenu);
} else if (theKey == ":help" || theKey == "#") {
showHelp();
}
} catch( e ) {}

return true;
}

function mykeypad_Update() {
var now = new Date();
var recordTime = null;
var mins = null;
var hours = null;

if(recordStartTime != null)
{
recordTime = Math.floor((now - recordStartTime)/1000);

mins = Math.floor(recordTime / 60);
if(mins>=1)
{
recordTime = mins + "m, " + (recordTime - (mins*60)) + "s";
} else { recordTime = recordTime + "s"; }

recordStatus.textualContent = "Recording: " + recordTime;
}
}


function moreMenu_ValueUpdated(theScreen, theProperty)
{
var uuid = moreMenuItemUUIDs[theScreen.selectedItem];

if( uuid == "takeScreenshot" ) {
SendVirtualKeystroke(0x73,false,false,false,false);
return false;
} else if( uuid == "switchFullscreen" ) {
SendVirtualKeystroke(0x46,false,true,false,false);
return false;
} else if( uuid == "switchRecording" ) {
switchRecording();
return false;
} else if( uuid == "showHelp" ) {
showHelp();
return false;
} else if( uuid == "shutdownTV" ) {
shutdownTV();
return false;
} else if( uuid == "switchInputSignal" ) {
SendVirtualKeystroke(0x41,false,true,false,false);
return true;
}
}



function switchRecording()
{
var recordQuestion = CreateQuestionDialog("record_");

if(recordStartTime == null)
{
recordQuestion.textualContent = "Do you really want to start recording the current TV program?";
} else {
recordQuestion.textualContent = "Stop recording?";
}
theTerminal.Push(recordQuestion);
}



function record_OK(w)
{
if(recordStartTime == null)
{
SendVirtualKeystroke(0x52,false,false,true,false);
recordStatus.textualContent = "!!! Recording !!!";
recordStartTime = new Date();
} else {
SendVirtualKeystroke(0x52,false,false,true,false);
recordStatus.textualContent = "";
recordStartTime = null;
}
}


function shutdownTV()
{
if(recordStartTime != null)
{
// Stop recording first!
SendVirtualKeystroke(0x52,false,false,true,false);
recordStatus.textualContent = "";
recordStartTime = null;
}

SendVirtualKeystroke(0x73,false,false,true,false);
tvStatus.textualContent = "tv is off";
}

function showHelp()
{
var code = new Array();
var title = new Array();
var description = new Array();

code[1] = new Array("v", "d");
title[1] = "Volume -";
description[1] = "Softens the listening volume.";

code[2] = new Array("^", "u");
title[2] = "Volume +";
description[2] = "Raises the listening volume.";

code[3] = new Array("<");
title[3] = "Channel -";
description[3] = "Jump to previous channel";

code[4] = new Array(">");
title[4] = "Channel +";
description[4] = "Jump to next channel";

code[5] = new Array("#");
title[5] = "Help";
description[5] = "Displays the key settings (help menu)";

code[6] = "1";
title[6] = "Channel 1";
description[6] = "When you press 1 PCTV Vision will jump to the tv channel 1";

code[7] = "2";
title[7] = "Channel 2";
description[7] = "When you press 2 PCTV Vision will jump to the tv channel 1";

code[8] = "3";
title[8] = "Channel 3";
description[8] = "When you press 3 PCTV Vision will jump to the tv channel 1";

code[9] = "4";
title[9] = "Channel 4";
description[9] = "When you press 4 PCTV Vision will jump to the tv channel 1";

code[10] = "5";
title[10] = "Channel 5";
description[10] = "When you press 5 PCTV Vision will jump to the tv channel 1";

code[11] = "6";
title[11] = "Channel 6";
description[11] = "When you press 6 PCTV Vision will jump to the tv channel 1";

code[12] = "7";
title[12] = "Channel 7";
description[12] = "When you press 7 PCTV Vision will jump to the tv channel 1";

code[13] = "8";
title[13] = "Channel 8";
description[13] = "When you press 8 PCTV Vision will jump to the tv channel 1";

code[14] = "9";
title[14] = "Channel 9";
description[14] = "When you press 9 PCTV Vision will jump to the tv channel 1";

theTerminal.ShowKeypadHelp("PCTV Controls", code, title, description);
}

[/code:1]
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
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