From 161cc97a59078a606c41c2ec2a6371dc04d5aac8 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Tue, 20 Sep 2011 20:29:58 +0200 Subject: Optional AltGr registering implemented --- evspy-core.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'evspy-core.h') diff --git a/evspy-core.h b/evspy-core.h index 03ade62..5b7abec 100644 --- a/evspy-core.h +++ b/evspy-core.h @@ -111,7 +111,7 @@ /* * Is the c event code associated to any of the FX buttons? */ -#define evs_isfX(c) \ +#define evs_isfX(c) \ ({ \ ((c) >= KEY_F1 && (c) <= KEY_F10) || \ ((c) == KEY_F11 || (c) == KEY_F12) || \ @@ -134,3 +134,23 @@ } \ __c; \ }) + +/* + * Returns the character associated with event code c when altgr is pressed + */ +#ifdef EVS_ALTGR_ENABLED +# define evs_altgr(c) \ + ({ \ + void *__vp; \ + char __c; \ + __vp = khm_get(ahm, (c)); \ + if (__vp) __c = *(char *)__vp; \ + else __c = map[c]; \ + __c; \ + }) +#else +# define evs_altgr(c) \ + ({ \ + (c); \ + }) +#endif -- cgit v1.2.3