Removed halfdelay and fixed some stuff about the animation.

reverse-branch
Guillaume B 17 years ago
parent 742224bb71
commit 01c5b4424c
  1. 11
      ttyclock.c

@ -40,6 +40,7 @@ init(void)
/* Init ncurses */
initscr();
cbreak();
noecho();
keypad(stdscr, True);
start_color();
@ -97,6 +98,8 @@ init(void)
set_center(ttyclock->option.center);
nodelay(ttyclock->framewin, TRUE);
wrefresh(ttyclock->datewin);
wrefresh(ttyclock->framewin);
@ -321,9 +324,9 @@ void
key_event(void)
{
halfdelay(1);
struct timespec length = { 0, UPDATETIME };
switch(getch())
switch(wgetch(ttyclock->framewin))
{
case KEY_UP:
case 'k':
@ -386,6 +389,10 @@ key_event(void)
if(ttyclock->option.rebound && ttyclock->option.center)
ttyclock->option.center = False;
break;
default:
nanosleep(&length, NULL);
break;
}
return;

Loading…
Cancel
Save