From 05639c477367fa436ef33a0a4dc5fc37215acd94 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Thu, 9 Oct 2008 20:23:45 +0100 Subject: Pass 'term' string into new_driver virtual method; have drivers sensitive to it and return NULL if they can't handle. Try CSI driver first; only for xterm-alikes --- driver-csi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'driver-csi.c') diff --git a/driver-csi.c b/driver-csi.c index f8188c8..be709a3 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -24,8 +24,18 @@ static termkey_keysym register_csi_ss3_full(termkey_csi *csi, termkey_type type, static termkey_keysym register_ss3kpalt_full(termkey_csi *csi, termkey_type type, termkey_keysym sym, int modifier_set, int modifier_mask, unsigned char cmd, const char *name, char kpalt); static termkey_keysym register_csifunc_full(termkey_csi *csi, termkey_type type, termkey_keysym sym, int modifier_set, int modifier_mask, int number, const char *name); -static void *new_driver(termkey_t *tk) +static void *new_driver(termkey_t *tk, const char *term) { + // Only care about term types beginning "xterm" + if(strncmp(term, "xterm", 5) != 0) + return NULL; + + // We want "xterm" or "xtermc" or "xterm-..." + if(term[5] != 0 && term[5] != '-' && term[5] != 'c') + return NULL; + + // Excellent - we'll continue + termkey_csi *csi = malloc(sizeof *csi); csi->tk = tk; -- cgit v1.2.3