From 8df79efc980dac2cbc555bf131680aa3e4f8609c Mon Sep 17 00:00:00 2001 From: ddouthitt Date: Fri, 12 Oct 2001 04:35:26 +0000 Subject: [PATCH] Re-enable client keys (make client_add_key work again) --- server/input.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/server/input.c b/server/input.c index 524504f..7906613 100644 --- a/server/input.c +++ b/server/input.c @@ -134,27 +134,27 @@ handle_input () } // if the current screen doesn't want it, - // ignore the key... + // let the server have it... -// else { -// // Give key to clients who want it -// -// c = FirstClient(clients); -// -// while (c) { -// // If the client should have this keypress... -// if(KeyWanted(c->data->client_keys,key)) { -// // Send keypress to client -// snprintf(str, sizeof(str), "key %c\n", key); -// sock_send_string(c->sock, str); -// break; // first come, first serve -// }; -// c = NextClient(clients); -// } // while clients -// -// // Give server a shot at all keys -// server_input (key); -// } + else { + // Give key to clients who want it + + c = FirstClient(clients); + + while (c) { + // If the client should have this keypress... + if(KeyWanted(c->data->client_keys,key)) { + // Send keypress to client + snprintf(str, sizeof(str), "key %c\n", key); + sock_send_string(c->sock, str); + break; // first come, first serve + }; + c = NextClient(clients); + } // while clients + + // Give server a shot at all keys + server_input (key); + } return 0; }