aboutsummaryrefslogtreecommitdiff
path: root/src/tui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui.c')
-rw-r--r--src/tui.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tui.c b/src/tui.c
index b7fb20f..aa08d52 100644
--- a/src/tui.c
+++ b/src/tui.c
@@ -31,8 +31,6 @@ void
init(void)
{
win = initscr();
- echo();
- cbreak();
clear();
refresh();
}
@@ -87,6 +85,7 @@ display_calc(int x, int y)
case digit: \
calcs[current_idx].input = \
add_input_digit(calcs[current_idx].input, digit - '0'); \
+ redraw(); \
break;
int
@@ -106,11 +105,12 @@ read_input(void)
return DISP_QUIT;
case '\n':
case KEY_ENTER:
- printf("ENTER PRESSED\n\r");
return calcs[current_idx].input;
case KEY_BACKSPACE:
+ case 0177: /* ASCII DEL character */
calcs[current_idx].input =
rm_input_digit(calcs[current_idx].input);
+ redraw();
break;
case_digit ('0')
case_digit ('1')
@@ -123,11 +123,10 @@ read_input(void)
case_digit ('8')
case_digit ('9')
default:
- return DISP_ERR;
+ break;
}
- redraw();
- c = getchar();
+ c = getch();
}
return DISP_ERR;