[nylug-workshop] DTK Holiday Work

Peter C. Norton
Mon Dec 4 10:14:26 EST 2006


On Sun, Dec 03, 2006 at 05:50:48PM -0500, Dan Crosta wrote:
> On Dec 3, 2006, at 12:33 AM, Peter C. Norton wrote:
> >Dan,
> >
> >Unless I'm missing something, I think that the mode you want for DTK
> >is self.scr.keypad(True).
> >
> >See the attached script to see why I think this is. See what values
> >are returned when keypad is enabled vs. disabled.
> >
> >Of course, tell me if I'm completely wrong :)
> >
> >-Peter
> 
> 
> Well I think there was a reason I had not used that method --  
> possibly just that I couldn't get it to work last time I tried. The  
> troublesome keys are always the non-letter keys: page up, page down,  
> end, home and friends; arrows; and the Fn keys, F1, F2, etc...
> 
> I'll be in DC this week presenting Trackle at LISA, but if the group  
> wants to work this into CursesEngine.py and InputHandler.py (probably  
> mostly into CursesEngine) then I will review any patches that result  
> and include them if they end up working better or result in cleaner  
> code than is currently in there (the latter, at least, seems somewhat  
> likely). The curses module defines a bunch of constants [1] that  
> might also be helpful for this.
> 
> - d
> 
> 
> [1] http://www.python.org/doc/2.3.5/lib/node221.html

Yes, I think it'd be good to try to reproduce just the engine behavior
in the script I wrote (i.e. getting distinct values out for all
keys). I'd like some other eyes because I couldn't get the behaviour
that I expected when looping to get characters.

In addition, we should start adding logging to the CursesEngine module
to give us the hooks we need. That may not jibe with the logging you
want - it'll be temporary.

That's the work for tomorrow!

-Peter

-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.



More information about the nylug-workshop mailing list