Applied patches supplied by Andre' Breiler:

- bugfixes for display != MatrixOrb LCD
	- changes the meaning of output_state
		+ it's now a bitfield where evry bit corresponds to
		  one output
	- protocol change
		output on|off|value
		where on    = all outputs on
		      off   = all outputs off
		      value = output on for all 1 bits
	- changes the behavior for key presses
	  Keypresses are now deliverd to _all_ clients (not only
	  the one with the active screen)
	reason: I have an client which is only active a few seconds after
                an keypress
	- changes the protocol so that a response is sent for every
	  command
	reason: the client needs to communicate with the server with a
                minimal latency
This commit is contained in:
William Ferrell
2001-03-22 22:51:49 +00:00
parent 5cc0287cff
commit 6dabd0b8f3
9 changed files with 131 additions and 60 deletions
+11 -21
View File
@@ -62,28 +62,18 @@ handle_input ()
debug ("handle_input(%c)\n", (char) key);
if (key) {
s = screenlist_current ();
if (s) {
c = s->parent;
if (c) {
// TODO: Interpret and translate keys!
// If the client should have this keypress...
// Send keypress to client
if (key >= 'E' && key <= 'Z') {
// TODO: Implement client "acceptable key" lists
sprintf (str, "key %c\n", key);
sock_send_string (c->sock, str);
}
// Otherwise, tell the server about it.
else {
server_input (key);
}
} else {
// If no parent, it means we're on the server screen.
// so, the server gets all keypresses there.
server_input (key);
}
/* s = screenlist_current (); */
c = (client *)LL_GetFirst(clients);
while(c) {
// TODO: Interpret and translate keys!
// If the client should have this keypress...
// Send keypress to client
// TODO: Implement client "acceptable key" lists
sprintf(str, "key %c\n", key);
sock_send_string(c->sock, str);
c = (client *)LL_GetNext(clients);
}
server_input (key);
}
return 0;