[mythtv-users] Optical encoder for MythTV scrolling

Itai Tavor itai at iinet.net.au
Mon Oct 3 11:53:48 UTC 2005


On 02/10/2005, at Sun 02/10 7:04PM, Itai Tavor wrote:

> Hi,
>
> I'm designing a front panel for a MythTV frontend, which will  
> include buttons for basic actions (up/down, left/right, play,  
> pause, menu, enter). Instead of using up/down buttons for  
> navigating in menus and lists, I'd like to use a round knob  
> connected to an optical encoder. My problem is that I'm going to  
> need software support...
>
> If I just convert encoder pulses into key presses, turning the knob  
> fast will cause a lot of presses to be queued which means that  
> scrolling will continue after the knob is stopped. So I think that  
> specific support for the encoder would be needed within MythTV.
>
> Since I'm not at all familiar with the MythTV code, I was wondering  
> if anyone could theorize on whether this would be possible, and  
> where I should look. What I imagine would be the biggest problem is  
> the tight integration that would be required between the encoder  
> event generator and the event receiver - the new code will have to  
> know when the receiver actually acted on the event so it can avoid  
> queuing events. If this implies that specific support would be  
> required in each Myth plugin, quick abandonment of the whole idea  
> would soon follow.

I'm going to reply to myself with a bit of progress and a new question:

I figured the best way to communicate the encoder events to myth is  
via lcdproc, so I'll have a PIC decoding the optical encoder pulses  
and creating lcdproc button events. That's easy.

The hard bit is avoiding queued events in mythtv/libs/libmyth/ 
lcddevice.cpp. I think I'll need to modify LCD::handleKeyPress so it  
doesn't do a postEvent if an up/down event is already queued... but  
looking through the QT documentation it doesn't seem possible to  
check for that. If that's the case, then what I need might require  
much bigger changes in event handling code throughout the code...

Any comments/ideas? TIA, Itai


More information about the mythtv-users mailing list