More formatting changes, new tags file.
This commit is contained in:
+58
-58
@@ -49,74 +49,74 @@ int server_input (int key);
|
||||
int
|
||||
handle_input ()
|
||||
{
|
||||
char str[256];
|
||||
int key;
|
||||
screen *s;
|
||||
client *c;
|
||||
char str[256];
|
||||
int key;
|
||||
screen *s;
|
||||
client *c;
|
||||
|
||||
key = lcd.getkey ();
|
||||
key = lcd.getkey ();
|
||||
|
||||
if (!key)
|
||||
return 0;
|
||||
if (!key)
|
||||
return 0;
|
||||
|
||||
debug ("handle_input(%c)\n", (char) key);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
server_input (int key)
|
||||
{
|
||||
debug ("server_input(%c)\n", (char) key);
|
||||
debug ("server_input(%c)\n", (char) key);
|
||||
|
||||
switch (key) {
|
||||
case 'A':
|
||||
if (screenlist_action == SCR_HOLD)
|
||||
screenlist_action = 0;
|
||||
else
|
||||
screenlist_action = SCR_HOLD;
|
||||
break;
|
||||
case 'B':
|
||||
screenlist_action = SCR_BACK;
|
||||
screenlist_prev ();
|
||||
break;
|
||||
case 'C':
|
||||
screenlist_action = SCR_SKIP;
|
||||
screenlist_next ();
|
||||
break;
|
||||
case 'D':
|
||||
debug ("got the menu key!\n");
|
||||
server_menu ();
|
||||
break;
|
||||
default:
|
||||
debug ("server_input: Invalid key \"%c\" (%i)\n", (char) key, key);
|
||||
break;
|
||||
}
|
||||
switch (key) {
|
||||
case 'A':
|
||||
if (screenlist_action == SCR_HOLD)
|
||||
screenlist_action = 0;
|
||||
else
|
||||
screenlist_action = SCR_HOLD;
|
||||
break;
|
||||
case 'B':
|
||||
screenlist_action = SCR_BACK;
|
||||
screenlist_prev ();
|
||||
break;
|
||||
case 'C':
|
||||
screenlist_action = SCR_SKIP;
|
||||
screenlist_next ();
|
||||
break;
|
||||
case 'D':
|
||||
debug ("got the menu key!\n");
|
||||
server_menu ();
|
||||
break;
|
||||
default:
|
||||
debug ("server_input: Invalid key \"%c\" (%i)\n", (char) key, key);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user