Skip to main content

oxidized_curses/
io_attrs.rs

1use ncurses::*;
2
3// tell ncurses whether to echo typed
4// characters to the screen
5pub fn set_echo(echo_val: bool) {
6    if echo_val {
7        echo();
8    } else {
9        noecho();
10    }
11}
12
13// tell ncurses whether to get raw input or not
14pub fn set_raw(raw_val: bool) {
15    if raw_val {
16        raw();
17    } else {
18        noraw();
19    }
20}
21
22// set whether ncurses gets raw input or not
23// minus control characters
24pub fn set_cbreak(cbreak_val: bool) {
25    if cbreak_val {
26        cbreak();
27    } else {
28        nocbreak();
29    }
30}