Skip to content

Commit

Permalink
tools: update keysym generation to current list of keysyms
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Aug 25, 2023
1 parent 12f9c01 commit 855956c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
8 changes: 6 additions & 2 deletions lib/keysyms/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from tempfile import TemporaryDirectory

repo = 'https://github.com/freedesktop/xorg-proto-x11proto.git'
xx = 'https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/tree/master/include/X11/'
repo = 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
pattern = r'#define XK_(\w+)\s+0x(\w+)(?:\s+/\*\s+U\+(\w+))?'
xf86pattern = r'#define XF86XK_(\w+)\s+0x(\w+)(?:\s+/\*\s+U\+(\w+))?'

Expand All @@ -15,14 +17,16 @@ def main():

with TemporaryDirectory() as temp:
run(['git', 'clone', repo, '.'], cwd=temp)
text = Path(temp, 'keysymdef.h').read_text()
# text = Path(temp, 'keysymdef.h').read_text()
text = Path(temp, 'include/X11/keysymdef.h').read_text()
for name, sym, uni in findall(pattern, text):
sym = int(sym, 16)
uni = int(uni, 16) if uni else None
if keysymdef.get(name, None):
print('KEY DUP', name)
keysymdef[name] = sym
text = Path(temp, 'XF86keysym.h').read_text()
# text = Path(temp, 'keysymdef.h').read_text()
text = Path(temp, 'include/X11/XF86keysym.h').read_text()
for name, sym, uni in findall(xf86pattern, text):
sym = int(sym, 16)
uni = int(uni, 16) if uni else None
Expand Down
26 changes: 20 additions & 6 deletions lib/keysyms/keysymdef.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# flake8: noqa E122
# flake8: noqa E127
# flake8: noqa
keysymdef = \
{'0': 48,
'1': 49,
Expand Down Expand Up @@ -1198,6 +1197,7 @@
'XF86_AudioNext': 269025047,
'XF86_AudioPause': 269025073,
'XF86_AudioPlay': 269025044,
'XF86_AudioPreset': 269025206,
'XF86_AudioPrev': 269025046,
'XF86_AudioRaiseVolume': 269025043,
'XF86_AudioRandomPlay': 269025177,
Expand Down Expand Up @@ -1236,6 +1236,7 @@
'XF86_Forward': 269025063,
'XF86_FrameBack': 269025181,
'XF86_FrameForward': 269025182,
'XF86_FullScreen': 269025208,
'XF86_Game': 269025118,
'XF86_Go': 269025119,
'XF86_Green': 269025188,
Expand All @@ -1246,6 +1247,7 @@
'XF86_KbdBrightnessDown': 269025030,
'XF86_KbdBrightnessUp': 269025029,
'XF86_KbdLightOnOff': 269025028,
'XF86_Keyboard': 269025203,
'XF86_Launch0': 269025088,
'XF86_Launch1': 269025089,
'XF86_Launch2': 269025090,
Expand All @@ -1266,6 +1268,7 @@
'XF86_LogGrabInfo': 269024805,
'XF86_LogOff': 269025121,
'XF86_LogWindowTree': 269024804,
'XF86_MacroRecordStart': 268964528,
'XF86_Mail': 269025049,
'XF86_MailForward': 269025168,
'XF86_Market': 269025122,
Expand All @@ -1275,6 +1278,7 @@
'XF86_MenuPB': 269025126,
'XF86_Messenger': 269025166,
'XF86_ModeLock': 269025025,
'XF86_MonBrightnessCycle': 269025031,
'XF86_MonBrightnessDown': 269025027,
'XF86_MonBrightnessUp': 269025026,
'XF86_Music': 269025170,
Expand All @@ -1294,6 +1298,7 @@
'XF86_PowerOff': 269025066,
'XF86_Prev_VMode': 269024803,
'XF86_Q': 269025136,
'XF86_RFKill': 269025205,
'XF86_Red': 269025187,
'XF86_Refresh': 269025065,
'XF86_Reload': 269025139,
Expand All @@ -1303,6 +1308,7 @@
'XF86_RockerUp': 269025059,
'XF86_RotateWindows': 269025140,
'XF86_RotationKB': 269025142,
'XF86_RotationLockToggle': 269025207,
'XF86_RotationPB': 269025141,
'XF86_Save': 269025143,
'XF86_ScreenSaver': 269025069,
Expand Down Expand Up @@ -1353,6 +1359,7 @@
'XF86_Video': 269025159,
'XF86_View': 269025185,
'XF86_WLAN': 269025173,
'XF86_WWAN': 269025204,
'XF86_WWW': 269025070,
'XF86_WakeUp': 269025067,
'XF86_WebCam': 269025167,
Expand Down Expand Up @@ -1719,6 +1726,11 @@
'circle': 3023,
'club': 2796,
'colon': 58,
'combining_acute': 16777985,
'combining_belowdot': 16778019,
'combining_grave': 16777984,
'combining_hook': 16777993,
'combining_tilde': 16777987,
'comma': 44,
'containsas': 16785931,
'copyright': 169,
Expand All @@ -1735,13 +1747,13 @@
'dead_E': 65155,
'dead_I': 65157,
'dead_O': 65159,
'dead_SCHWA': 65163,
'dead_U': 65161,
'dead_a': 65152,
'dead_abovecomma': 65124,
'dead_abovedot': 65110,
'dead_abovereversedcomma': 65125,
'dead_abovering': 65112,
'dead_aboveverticalline': 65169,
'dead_acute': 65105,
'dead_belowbreve': 65131,
'dead_belowcircumflex': 65129,
Expand All @@ -1751,7 +1763,6 @@
'dead_belowmacron': 65128,
'dead_belowring': 65127,
'dead_belowtilde': 65130,
'dead_belowverticalline': 65170,
'dead_breve': 65109,
'dead_capital_schwa': 65163,
'dead_caron': 65114,
Expand All @@ -1765,18 +1776,18 @@
'dead_e': 65154,
'dead_grave': 65104,
'dead_greek': 65164,
'dead_hamza': 65165,
'dead_hook': 65121,
'dead_horn': 65122,
'dead_i': 65156,
'dead_invertedbreve': 65133,
'dead_iota': 65117,
'dead_longsolidusoverlay': 65171,
'dead_lowline': 65168,
'dead_macron': 65108,
'dead_o': 65158,
'dead_ogonek': 65116,
'dead_perispomeni': 65107,
'dead_psili': 65124,
'dead_schwa': 65162,
'dead_semivoiced_sound': 65119,
'dead_small_schwa': 65162,
'dead_stroke': 65123,
Expand Down Expand Up @@ -1871,6 +1882,8 @@
'grave': 96,
'greater': 62,
'greaterthanequal': 2238,
'guillemetleft': 171,
'guillemetright': 187,
'guillemotleft': 171,
'guillemotright': 187,
'h': 104,
Expand Down Expand Up @@ -2113,6 +2126,7 @@
'opentribulletdown': 2788,
'opentribulletup': 2787,
'ordfeminine': 170,
'ordmasculine': 186,
'oslash': 248,
'otilde': 245,
'overbar': 3008,
Expand Down

0 comments on commit 855956c

Please sign in to comment.