First of all, kudos to all who have contributed to sup (especially
William!). Its the bees knees.
One issue:
At least on my slow computer, the time it takes to dispatch even a simple
action (like cursor_down) is a bit longer than my keyboard''s repeat
interval.
So, when I hold down ''j'' to scroll through several messages,
it continues to
scroll for a few seconds after I release the key, causing me to overshoot my
target every time.
I''ve got a solution that works on my system, adding
''Ncurses.stdscr.nodelay1'' to start_cursing, and modifying
nonblocking_getch as follows:
def nonblocking_getch
if IO.select([$stdin], nil, nil, 1)
repeat = c = Ncurses.getch
repeat = Ncurses.getch until repeat != c
c
else
nil
end
end
This effectively discards the extra keystrokes that accumulate while the
action is taking place, and makes the UI seem more responsive (even though
it isn''t actually any faster).
As a side note: having added nodelay, there doesn''t seem to be any real
reason we would need to keep the IO.select... but in my brief
experimentation I found various unpleasant side-effects when I tried to
remove it. I guess it doesn''t hurt anything to leave it in.
There may also be side-effects that I haven''t noticed from using
nodelay,
but everything seems to work as it should.
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/sup-talk/attachments/20080220/0c1c9318/attachment.html