3 from __future__ import print_function
8 '/usr/include/X11/keysymdef.h',
9 '/usr/include/X11/XF86keysym.h',
10 '/usr/include/X11/Sunkeysym.h',
11 '/usr/include/X11/DECkeysym.h',
12 '/usr/include/X11/HPkeysym.h',
15 print('''#ifndef _XKBCOMMON_KEYSYMS_H
16 #define _XKBCOMMON_KEYSYMS_H
18 /* This file is autogenerated; please do not commit directly. */
20 #define XKB_KEY_NoSymbol 0x000000 /* Special KeySym */
23 with open(path) as header:
25 if '#ifdef' in line or '#ifndef' in line or '#endif' in line:
28 # Remove #define _OSF_Keysyms and such.
29 if '#define _' in line:
32 # Handle a duplicate definition in HPkeysyms.h which kicks in if
33 # it's not already defined.
34 if 'XK_Ydiaeresis' in line and '0x100000ee' in line:
37 line = re.sub(r'#define\s*(\w*)XK_', r'#define XKB_KEY_\1', line)