This commit is contained in:
Kovid Goyal 2019-06-11 16:54:55 +05:30
parent 0fafc07db0
commit 9da095ca50
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -15,10 +15,14 @@ def null_lookup(name, case_sensitive=False):
def get_key_name_lookup():
return null_lookup
else:
def load_libxkb_lookup():
import ctypes
lib = ctypes.CDLL('libxkbcommon.so')
for suffix in ('.0', ''):
try:
lib = ctypes.CDLL('libxkbcommon.so' + suffix)
break
except Exception:
pass
f = lib.xkb_keysym_from_name
f.argtypes = [ctypes.c_char_p, ctypes.c_int]
f.restype = ctypes.c_int