2 from __future__ import print_function
7 prefix = os.environ.get('X11_HEADERS_PREFIX', '/usr')
9 prefix + '/include/X11/keysymdef.h',
10 prefix + '/include/X11/XF86keysym.h',
11 prefix + '/include/X11/Sunkeysym.h',
12 prefix + '/include/X11/DECkeysym.h',
13 prefix + '/include/X11/HPkeysym.h',
16 print('''#ifndef _XKBCOMMON_KEYSYMS_H
17 #define _XKBCOMMON_KEYSYMS_H
19 /* This file is autogenerated; please do not commit directly. */
21 #define XKB_KEY_NoSymbol 0x000000 /* Special KeySym */
24 with open(path) as header:
26 if '#ifdef' in line or '#ifndef' in line or '#endif' in line:
29 # Remove #define _OSF_Keysyms and such.
30 if '#define _' in line:
33 # Handle a duplicate definition in HPkeysyms.h which kicks in if
34 # it's not already defined.
35 if 'XK_Ydiaeresis' in line and '0x100000ee' in line:
38 line = re.sub(r'#define\s*(\w*)XK_', r'#define XKB_KEY_\1', line)