Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Rotary Wheel to mimic held down button
This thread has 12 replies. Displaying all posts.
Post 1 made on Sunday January 11, 2009 at 07:16
mrashton
Lurking Member
Joined:
Posts:
June 2008
9
With an iPod dock connected to a Yamaha RX-V3800 I want to use the rotary wheel to navigate the song list on the TV screen. Any ideas how I can mimic holding a button with more than 2 clicks of the rotary wheel (clicks > 2 or clicks < -2) until the rotary wheel stops (clicks = 0)?
By holding a button, navigation of the list speeds up and I would like to use the rotary wheel to achieve this.

Last edited by mrashton on January 11, 2009 13:29.
Post 2 made on Sunday January 11, 2009 at 19:44
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Rotary clicks are measured on a per second basis. That means if the wheel registers 3 clicks in one second; onRotary will report three. Using the Rotary wheel for a 'Hold' function seems a little bit impossible... It sounds like you are trying to scroll based on a key press: This is somewhat contrary to Rotary methods unfortunately.

Although I would prefer to take another route, you could try the following:

-The Rotary wheel scans for clicks every second and reports them to onRotary.
-If you combine a timer mechanism with the rotary wheel report; you could look for a minimum of two clicks each second.
-Combine all that with a While loop: While Click == 2 every second execute or maintain your Hold action.

Hope this helps!

Cheers // Jason

PS: Does your Yamaha take control of the iPod through the dock and are you able to send RS232 commands to the Yamaha effectively controlling the iPod indirectly?
You can hide almost anything until you have to put the drywall up!
OP | Post 3 made on Monday January 12, 2009 at 08:00
mrashton
Lurking Member
Joined:
Posts:
June 2008
9
Thanks Jason. Now I understand the returning of number of clicks per second, is there a way of commanding a button to act as Button Hold instead of just a Button Press with immediate release? I understand the onHold and onHoldInterval functions but I want to mimic a button to be held which in turn will mimic the use of the iPod scroll wheel.

To answer your PS: The Yamaha takes control of the iPod but I don't think the iPod can be controlled indirectly using RS232 when attached to the Yamaha Dock.

Regards,
Matthew

Last edited by mrashton on January 12, 2009 10:19.
Post 4 made on Tuesday January 13, 2009 at 11:31
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
If the command is an IR command you could go into myDatabase and extend the command length for any given IR command such that it sends for 'x' number of milliseconds when pressed. Each function has a 'duration' that can be overriden to any number of milliseconds you need.

If the command is script related:

Put script into the button that turns it into a toggle that calls a function. The function will then repeat your command when in the on state and will do nothing when in the off state. The script example below is a quick and dirty and would require a little bit of additional work to 'get it working'.

Activity Script
var PushMe = "Dont";
function HoldButton(Action)
{
// Code to hold down or repeat your button command
}

Widget Script

if (PushMe =="Dont")
{
PushMe = "Do";
HoldButton("Push");
}
else
{
PushMe = "Dont";
HoldButton("StopPush");
}

Cheers // Jason
You can hide almost anything until you have to put the drywall up!
OP | Post 5 made on Tuesday January 13, 2009 at 15:25
mrashton
Lurking Member
Joined:
Posts:
June 2008
9
Thanks again!

It would be great to be able to adjust the IR code duration dynamically from within a script. Is this possible? I can't find any reference in the Developer Guide. If not, I will revert to extending the duration in the database for the specific button (or a copy thereof).
Post 6 made on Tuesday January 13, 2009 at 15:52
judderod
Lurking Member
Joined:
Posts:
October 2008
4
I'd like to know if you get the script to work - I'd like to be able to use this for controlling my Sky HD but I really haven't a clue about prontoscript. My code experience goes as far as programming BASIC on a BBC computer!

I use the scroll wheel to send up or down so I can navigate the program guide easily. It's also set to jump back and forth a page if you scroll quickly, but for just slow scrolling it seems that pressing and holding the actual up or down buttons makes the selector on screen scroll much quicker even though the IR code is the same. I'm sure it's a clean learn as I've tried out several different learn methods and this code is the shortest that works well.
Post 7 made on Tuesday January 13, 2009 at 17:56
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Hi Matthew,
I would love to see Philips add a ton more properties and methods into Prontoscript from the generic javascript, but from what I've seen it's not likely in the near future. It's not a bad thing; you just have to use a different path. I have yet to be stopped by a lack of functionality in Prontoscript although I could do a lot of things a lot quicker if there was more functionality.

All that being said: I'm not aware of a property that would allow you to adjust IR duration during runtime. I think you've already found the solution by the looks of it. Creating two instances of the same IR function; one with an extended duration and the other at default would definitely address the issue.

Cheers // Jason
You can hide almost anything until you have to put the drywall up!
Post 8 made on Tuesday January 13, 2009 at 18:06
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Hi judderrod,

if you're able to program the rotary wheel, you've gotten a good taste of javascript already. If you're looking for syntax and structure information, try dialing up W3Schools on google. They have a pretty good reference and getting started section for Javascript. Considering you come from the Basic world, you'll find javascript to be seriously lacking in verbocity; other than that a loop is a loop and an if statement is still an if statement!

Regarding slow scrolling the rotary wheel: It can be done! Before jumping into velocity control for the wheel: The reason the scroll wheel accelerates is based on the fact that it reports how many clicks have passed each second. So if you get rotary happy and spin the little bugger quickly the first time it might skip forward as much as 4 clicks in one second; whereas if you give it a gentle nudge it may report 0 or 1. Put a governor in your onRotary function such that if (clicks >=1) {clicks = 1}.
With the governor in place, no matter how fast you spin the rotary wheel it will always click forward one click at a time.

Hope this helps!

Cheers // Jason
You can hide almost anything until you have to put the drywall up!
Post 9 made on Thursday January 15, 2009 at 09:20
judderod
Lurking Member
Joined:
Posts:
October 2008
4
Thanks Jason that's good to know...

I might try assiging a different duration of button hold for each possible number of clicks. E.g. (in plain english)

If clicks = 1, press and release
If clicks = 2, press and hold for 1 second
If clicks = 3, press and hold for 2 seconds
etc.

This method does seem a bit archaic, I wonder if there is any way to dynamically and continuously relate the number of clicks to a button press duration. I think there'd probably need to be a minor delay and a buffer somewhere in there - far too complicated for me!

The other possibility is for me to re-work the IR code in such a way that no pause is introduced at the end of each button press (is that what happens)? It's the only way I can understand why if you press a button repeatedly very quickly, the response on the receiving device will be limited to a certain number per second. However if you press and hold the same button, the number of responses per second are far more.

As if when you press the up button rapidly (or in my case rotate the wheel quickly), the IR being sent goes something like:

Hello > Up > Wait. Hello > Up > Wait. Hello > Up > Wait...

But if you press and hold:

Hello > Up > Wait > Up Up Up Up Up Up > Wait.
Post 10 made on Sunday January 18, 2009 at 15:12
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
You could try and relate the clicks per second to the pronto script onHold & onHoldInterval functions. onHold is meant to act as the script equivalent to holding the button down on the TSU. You can also play with the interval with onHoldInterval which sets the number of milliseconds between repeats of the command.
You can hide almost anything until you have to put the drywall up!
OP | Post 11 made on Monday January 19, 2009 at 14:58
mrashton
Lurking Member
Joined:
Posts:
June 2008
9
Hi Jason,

The onHold function allows one to program an action to be repeated for as long as a button is pressed. We need a function that mimics pressing a button for a specified amount of time.
Post 12 made on Monday January 19, 2009 at 18:24
GuerillaBuild
Long Time Member
Joined:
Posts:
December 2008
79
Hi Matthew,
Although it's not a perfect solution, setting the onHoldInterval to a ridiculously small number of milliseconds may reduce the gap between repeated signals to the point that it is interpreted as a constant stream or button hold when used in conjunction with the onHold command.
Also, from what I've read on IR signals, they are usually coded as a repeating signal with a specific gap between pulses for 'hold' scenarios. I may be completely wrong on the IR signal format; my knowledge in this area (hex code strings) is somewhat limited.

Cheers // Jason
You can hide almost anything until you have to put the drywall up!
Post 13 made on Monday January 19, 2009 at 22:20
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,992
MRashton,

A function to mimic a button press for a specific amount of time is not available. Widget.executeActions() not being able to simulate a press and hold is a known issue and this thread discusses the issue further.

[Link: remotecentral.com]

You will need different widgets, each with IR codes of longer lengths by hacking the IR code data to extend the code(1 - short, 3 - long) for each rotary direction as Widget.executeActions() cannot simulate press and hold as you would from normal button press.

For tips on how to extend IR codes, see this post.

[Link: remotecentral.com]
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse