summaryrefslogtreecommitdiffstats
path: root/linux/osd/SimpleXkbWrapper.py
diff options
context:
space:
mode:
authormartinZuther <martinZuther@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2010-10-15 20:18:11 +0000
committermartinZuther <martinZuther@b9310e46-f624-0410-8ea1-cfbb3a30dc96>2010-10-15 20:18:11 +0000
commitda0122fa104e6bae61824e49b6f1007b9989b9c7 (patch)
tree14ecc3878d7a0bab62291895c0e171739e4f68cc /linux/osd/SimpleXkbWrapper.py
parentbb0bc80bc5762fcb658c82c5a58e421ca79f94fd (diff)
OSDneo2: Skript sucht sich jetzt die richtige Library heraus
git-svn-id: https://svn.neo-layout.org@2352 b9310e46-f624-0410-8ea1-cfbb3a30dc96
Diffstat (limited to '')
-rwxr-xr-xlinux/osd/SimpleXkbWrapper.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/linux/osd/SimpleXkbWrapper.py b/linux/osd/SimpleXkbWrapper.py
index 9ce9572..12870c3 100755
--- a/linux/osd/SimpleXkbWrapper.py
+++ b/linux/osd/SimpleXkbWrapper.py
@@ -5,7 +5,7 @@
========
On screen display for learning the keyboard layout Neo2
- Copyright (c) 2009 Martin Zuther (http://www.mzuther.de/)
+ Copyright (c) 2009-2010 Martin Zuther (http://www.mzuther.de/)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -139,13 +139,18 @@ class SimpleXkbWrapper:
def __init__(self):
- # dynamically link to "X Keyboard Extension" library
- library_xf86misc = ctypes.CDLL(ctypes.util.find_library('Xxf86misc'))
+ # dynamically link to "X Keyboard Extension" library while at
+ # the same time checking which library to use
+ xkbd_library_location = ctypes.util.find_library('Xxf86misc')
+ if not xkbd_library_location:
+ xkbd_library_location = ctypes.util.find_library('X11')
+
+ xkbd_library = ctypes.CDLL(xkbd_library_location)
# print debugging information if requested
if self.DEBUG_XKB:
print
- print ' %s' % library_xf86misc
+ print ' %s' % xkbd_library
@@ -181,7 +186,7 @@ class SimpleXkbWrapper:
# set-up function (low-level)
self.__XkbOpenDisplay__ = prototype_xkbopendisplay( \
- ('XkbOpenDisplay', library_xf86misc), \
+ ('XkbOpenDisplay', xkbd_library), \
paramflags_xkbopendisplay \
)
@@ -253,7 +258,7 @@ class SimpleXkbWrapper:
# set-up function (low-level)
self.__XkbGetState__ = prototype_xkbgetstate( \
- ('XkbGetState', library_xf86misc), \
+ ('XkbGetState', xkbd_library), \
paramflags_xkbgetstate \
)