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