Clients must now request keys using either client_add_key or screen_add_key to receive key events. If a screen is active (on the display) and it has registered a key with "screen_add_key" it will be the only client to get that key. If the current screen doesn't want the key, it will be sent to all clients that have registered that key using "client_add_key". If you want to define a "hot button" for your client, you should probably register that "hot key" with "client_add_key" and then list the keys that control your client with "screen_add_key" on each screen. If you don't have a "hot key", then just register keys with "screen_add_key" and you'll get keystrokes only when your screen is active. Also fixed some formatting (spaces versus tabs) in a couple of places.
25 lines
477 B
C
25 lines
477 B
C
#ifndef CLIENT_DATA_H
|
|
#define CLIENT_DATA_H
|
|
|
|
#include "../shared/LL.h"
|
|
|
|
#define CLIENT_NAME_SIZE 256
|
|
|
|
typedef struct client_data {
|
|
int ack;
|
|
char *name;
|
|
// and other stuff... doesn't matter yet
|
|
LL *screenlist;
|
|
// list of requested keys...
|
|
char *client_keys ;
|
|
LL *menulist;
|
|
|
|
} client_data;
|
|
|
|
// sets up an existing (empty) client_data struct
|
|
int client_data_init (client_data * d);
|
|
// destroys members of a client's data
|
|
int client_data_destroy (client_data * d);
|
|
|
|
#endif
|