organized the archived xkb code

xkb
sezanzeb 4 years ago committed by sezanzeb
parent 364170c71b
commit 71de04b626

@ -19,9 +19,10 @@
# along with key-mapper. If not, see <https://www.gnu.org/licenses/>.
"""Quite some code that is not used anymore, but might be in the future.
"""Code that is not used anymore, but might be in the future.
Currently it is not needed to create symbols files in xkb. Very sad.
Currently it is not needed to create symbols files in xkb. Which is a pity
considering all the work put into this. This stuff is even unittested.
Resources:
[1] https://wiki.archlinux.org/index.php/Keyboard_input
@ -198,10 +199,11 @@ def generate_symbols(
# key-mapper will write target_keycode into /dev, while
# system_keycode should do nothing to avoid a duplicate keystroke.
print('writing', system_keycode, target_keycode, character)
if target_keycode is not None:
if f'<{target_keycode}>' not in keycodes:
logger.error(f'Unknown code <{target_keycode}> for "{character}"')
logger.error(
f'Unknown code <{target_keycode}> for "{character}"'
)
# don't append that one, otherwise X would crash when loading
continue
xkb_symbols.append(

@ -23,7 +23,7 @@ import os
import unittest
import shutil
from keymapper.xkb import custom_mapping, generate_symbols, \
from keymapper.archive.xkb import custom_mapping, generate_symbols, \
create_identity_mapping, create_setxkbmap_config, \
get_preset_name, create_default_symbols, parse_symbols_file
from keymapper.paths import get_usr_path, KEYCODES_PATH, USERS_SYMBOLS

@ -26,7 +26,7 @@ import time
from keymapper.presets import find_newest_preset, rename_preset, \
get_any_preset, delete_preset
from keymapper.xkb import create_preset
from keymapper.archive.xkb import create_preset
from keymapper.paths import USERS_SYMBOLS
from test import tmp

Loading…
Cancel
Save