2 /* This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 /* ---------------------------- included header files ---------------------- */
22 #include "libs/charmap.h"
23 #include "libs/modifiers.h"
25 /* ---------------------------- local definitions -------------------------- */
27 /* ---------------------------- local macros ------------------------------- */
29 /* ---------------------------- imports ------------------------------------ */
31 /* ---------------------------- included code files ------------------------ */
33 /* ---------------------------- local types -------------------------------- */
35 /* ---------------------------- forward declarations ----------------------- */
37 /* ---------------------------- local variables ---------------------------- */
39 /* ---------------------------- exported variables (globals) --------------- */
41 /* The keys must be in lower case! */
42 charmap_t key_modifiers
[] =
58 /* Table to translate a modifier map index to a modifier that we define that
59 * generates that index. This mapping can be chosen by each client, but the
60 * settings below try to emulate the usual terminal behaviour. */
61 unsigned int modifier_mapindex_to_mask
[8] =
64 Mod3Mask
, /* Alt Gr */
66 /* Just guessing below here - LockMask is not used anywhere*/
68 Mod1Mask
, /* Alt/Meta on XFree86 */
69 Mod2Mask
, /* Num lock on XFree86 */
71 Mod5Mask
, /* Scroll lock on XFree86 */
74 /* ---------------------------- local functions ---------------------------- */
76 /* ---------------------------- interface functions ------------------------ */
78 /* Converts the input string into a mask with bits for the modifiers */
79 int modifiers_string_to_modmask(char *in_modifiers
, int *out_modifier_mask
)
83 error
= charmap_string_to_mask(
84 out_modifier_mask
, in_modifiers
, key_modifiers
,