Added udpclient #2

This commit is contained in:
2017-12-15 12:36:47 +01:00
parent c298de57a8
commit 4651ee674a
4 changed files with 53 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
break;
case 'i':
//connect to a csoundbox server
inputNetwork(optarg);
break;
case 'l':
default:
@@ -70,6 +70,24 @@ void inputLocal(void) {
endwin();
}
void inputNetwork(char *server) {
initscr();
nonl(); //no newline
noecho();
keypad(stdscr, FALSE); //Disable the F1-12 keypad
curs_set(0); //Disable the cursor
printCursesWelcome();
char input[2];
while ((input[0] = getch()) != 13) {
input[1] = '\0';
sendKeyUDP(server, input);
}
endwin();
}
void printCursesWelcome(void) {
int y, x;
getmaxyx(stdscr, y, x);