FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

[Request] GOM Player Remote Help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
tester
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Fri Jun 01, 2007 10:50 am    Post subject: [Request] GOM Player Remote Help Reply with quote

Greetings,
Could someone help me out? I have no programming experience, and I want to create a simple remote control for GOM Player.
Needed functions are as follows:
Play/Puse - Space
Backward 10sec - Left
Forward 10sec – Right

Also with VK_UP/DOWN the sound is controlled.

var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "Keypad Sample";
widget.CreateRow( "Demo", scCenter, scClip, scLarge );
widget.CreateRow( "Use the d-pad", scCenter, scWrap, scMedium );
theTerminal.Push( widget );

function mykeypad_KeyDown(theScreen, theKey)
{
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( 0x25, false );
} else if( theKey == "<" ) {
// VK_LEFT
SendVirtualKeystroke( 0x25, false );
} else if( theKey == ">" ) {
// VK_RIGHT
SendVirtualKeystroke( 0x27, false );
} else if( theKey == "u" )

// Keep the keypad active
return true;
}

This part I finished my self.


Now the hard part, for me. I want Backward and Forward to have keyrepeat, so I can shift further, faster.

The second thing. I want the below functions to be handled by numeric pad of my phone (SE T630). Num on my phone.

Num7 - Fillscreen - Enter
Num 8 - Previous File - PageUp
Num 9 - Next File – PageDown



Could someone help me out?
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Jun 01, 2007 11:13 am    Post subject: Reply with quote

Add the function: mykeypad_KeyRepeat

What do you find problematic about responding to numeric keys in addition to the directional keys?

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tester
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Fri Jun 01, 2007 5:42 pm    Post subject: Reply with quote

The problem is that this is my first script. :lol:
I don’t know how to do it.
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Jun 01, 2007 6:26 pm    Post subject: Reply with quote

If think if you knew how to write the code you posted you'd also know how to add a mykeypad_KeyRepeat() handler. Why not inspect the standard scripts to see how it's done?

Best.
--
Jonas

[quote="tester"]The problem is that this is my first script. :lol:
I don’t know how to do it.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tester
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Sat Jun 02, 2007 11:33 am    Post subject: Reply with quote

As you know, the code is a small modification of the one posted here: http://www.salling.com/forums/viewtopic.php?t=2930, “Tutorial: A very simple script sample”

That’s what I’ve done:
[code:1]
var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "GOM Player";
widget.CreateRow( "GOM", scCenter, scClip, scLarge );
widget.CreateRow( "GOM Player", scCenter, scWrap, scMedium );
theTerminal.Push( widget );

function mykeypad_KeyDown(theScreen, theKey)
{
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 );
} else if( theKey == "7" ) {
SendVirtualKeystroke(0x0D,false); VK_RETURN
} else if( theKey == "8" ) {
SendVirtualKeystroke(0x21,false); VK_PRIOR
} else if( theKey == "9" ) {
SendVirtualKeystroke(0x22,false); VK_NEXT
} else if( theKey == "4" ) {
SendVirtualKeystroke(0x25,false), SendVirtualKeyDown(0x11,false); VK_CONTROL + VK_LEFT
} else if( theKey == "6" ) {
SendVirtualKeystroke(0x27,false), SendVirtualKeyDown(0x11,false); VK_CONTROL + VK_RIGHT
}

// Keep the keypad active
return true;
}

function mykeypad_KeyRepeat( theScreen, theKey )
{
if( theKey == "<" ) {
// VK_LEFT
SendVirtualKeystroke( 0x25, false );
} else if( theKey == ">" ) {
// VK_RIGHT
SendVirtualKeystroke( 0x27, false );
} else if( theKey == "u" )
keyRepeated = true;
}
[/code:1]

If I know how to write code, would I ask for help?!
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Sat Jun 02, 2007 1:24 pm    Post subject: Reply with quote

Excellent. That should take care of the key repeats like you wanted them. Now, for the numeric keys:

if( theKey == "1" ) {
...
} else if( theKey == "2" ) {
...
}
etc...

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CannedBass
Newbie


Joined: 15 Apr 2007
Posts: 4

PostPosted: Wed Jun 06, 2007 7:43 pm    Post subject: Reply with quote

hey, would you mind posting this on the forums when you have it working? I've been waiting for someone to make a remote for GOM.
Back to top
View user's profile Send private message
tester
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Sat Jun 09, 2007 12:07 pm    Post subject: Reply with quote

That’s all with detailed description. You can the key assignment in the picture below. If you find them uncomfortable you can modify them as you wish.

[img]http://bp3.blogger.com/_yEKmzhgZYjI/Rmp6d-EEnHI/AAAAAAAAAZ8/-UYJKygpDNE/s400/Schematic.jpg[/img]

In order to use the script, you need to create two files. Just copy and past the following.

Or you can download the attached file.

Gomeremote.xml
[code:1]
<?xml version="1.0" encoding="utf-8"?>

<ClickerScript>
<Path>gomremote.js</Path>
<Author>Salling Software AB</Author>
<Category>GOM Player</Category>
<Description></Description>
<UUID>D0189DF0-CF32-4018-9F0F-6EF36B7F9677</UUID>
<Title>GOM Remote</Title>
<Type>ClickerItem</Type>
<URL>http://clicker.salling.com</URL>
</ClickerScript>
[/code:1]

Gomremote.js

[code:1]
var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "GOM Player";
widget.CreateRow( "GOM", scCenter, scClip, scLarge );
widget.CreateRow( "GOM Player", scCenter, scWrap, scMedium );
theTerminal.Push( widget );

function mykeypad_KeyDown(theScreen, theKey)
{
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 );
} else if( theKey == "5" ) {
SendVirtualKeystroke(0x0D,false); VK_RETURN
} else if( theKey == "7" ) {
SendVirtualKeystroke(0x21,false); VK_PRIOR
} else if( theKey == "9" ) {
SendVirtualKeystroke(0x22,false); VK_NEXT
} else if( theKey == "1" ) {
SendVirtualKeystroke(0x25,false), SendVirtualKeyDown(0x11,false); VK_CONTROL + VK_LEFT
} else if( theKey == "3" ) {
SendVirtualKeystroke(0x27,false), SendVirtualKeyDown(0x11,false); VK_CONTROL + VK_RIGHT
}

// Keep the keypad active
return true;
}

function mykeypad_KeyRepeat( theScreen, theKey )
{
if( theKey == "<" ) {
// VK_LEFT
SendVirtualKeystroke( 0x25, false );
} else if( theKey == ">" ) {
// VK_RIGHT
SendVirtualKeystroke( 0x27, false );
} else if( theKey == "u" )
keyRepeated = true;
}
[/code:1]

Thanks Jonas



Gom Player.rar
 Description:

Download
 Filename:  Gom Player.rar
 Filesize:  893 Bytes
 Downloaded:  2197 Time(s)

Back to top
View user's profile Send private message
ckaidi
Newbie


Joined: 21 Aug 2007
Posts: 5

PostPosted: Thu Aug 23, 2007 8:06 pm    Post subject: Reply with quote

Not working in wm5?
can help?
hope to hav STOP and CLOSE/EXIT control also thank!!
Back to top
View user's profile Send private message
Runarius
Senior Member


Joined: 19 Nov 2006
Posts: 124

PostPosted: Thu Aug 23, 2007 9:36 pm    Post subject: Reply with quote

just tell me all the keys that GOM-player uses and I'll add them to my all-around script=D
Back to top
View user's profile Send private message
ckaidi
Newbie


Joined: 21 Aug 2007
Posts: 5

PostPosted: Fri Aug 24, 2007 6:51 am    Post subject: Reply with quote

[quote="Runarius"]just tell me all the keys that GOM-player uses and I'll add them to my all-around script=D[/quote]

hey thanks but wat do i need to tell u? the keys mean the function is it?
if so den as of wat WMP offer will be good enough :lol:
Back to top
View user's profile Send private message
Runarius
Senior Member


Joined: 19 Nov 2006
Posts: 124

PostPosted: Fri Aug 24, 2007 9:49 am    Post subject: Reply with quote

heh, sorry, meant a list like this:

Play/Puse - Space
Backward 10sec - Left
Forward 10sec – Right

only one thata is more complete.
Back to top
View user's profile Send private message
dmitriydonskoy
Newbie


Joined: 02 Feb 2008
Posts: 1

PostPosted: Sun Feb 03, 2008 12:09 am    Post subject: Reply with quote

:D Thanks for script!
Maybe you have some additions to gomPlayer?
especially I've interested in:
1. launch gomplayer
2. use(manage) the playlist
:roll:

best regards!
Have a nice day :wink:
Back to top
View user's profile Send private message
dore9fi
Newbie


Joined: 23 Dec 2008
Posts: 5

PostPosted: Tue Dec 23, 2008 10:47 pm    Post subject: Reply with quote

Thanks to the OP for the great script.

Could someone please help me change the layout of the buttons for this script!

Or post a dummies guide link for me, because I know nothing about scripts.
Please


This is the layout

RIGHT=Right Arrow
LEFT=Left Arrow
UP=Up Arrow
DOWN=Down Arrow
Center button=Spacebar
0=M
1=Alt + H
2=Page Up
3=Page Down
4=Shift + Right Arrow
5=Ctrl + D
6=Ctrl + I
7= -
8=Enter
9=+
HASH=Alt + F4
STAR=Launch gom player

Thanks you very much
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Wed Dec 24, 2008 3:51 am    Post subject: Reply with quote

[quote="dore9fi"]
Could someone please help me change the layout of the buttons for this script!
[/quote]

Open Gomremote.js with e.g. notepad and modify the virtual keystrokes so they match your setup.

Lookup the virtual-key codes here:
http://msdn.microsoft.com/en-us/library/ms645540.aspx

Example:
VK_RIGHT (0x27)
RIGHT ARROW key
-->
SendVirtualKeystroke( 0x27, false );

Combinations (e.g. ALT+H) are handled in a similar way:
-->
SendVirtualKeystroke( 0x48, false, false, true, false );
See http://www.salling.com/forums/viewtopic.php?t=3046 for details.

---------------------------
Launch GOM-Player
---------------------------

Add this to the top of the script and point it to the correct folder / executable:

var exe = "C:\Program Files\..\something.exe"

And finally:

function mykeypad_KeyDown(theScreen, theKey)
{

..

else if (theKey=="*") {
new ActiveXObject("Shell.Application").ShellExecute( exe );
}

..
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 1, 2  Next
Page 1 of 2

 
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