vnc: qemu ext keys

This commit is contained in:
Devaev Maxim
2020-10-08 15:26:37 +03:00
parent f1910f7c8e
commit a0b920a9d6
7 changed files with 114 additions and 28 deletions

View File

@@ -25,16 +25,17 @@ from typing import Dict
from typing import Generator
from .keysym import SymmapModifiers
from .mappings import WebModifiers
# =====
def text_to_web_keys(
text: str,
symmap: Dict[int, Dict[int, str]],
shift_key: str="ShiftLeft",
shift_key: str=WebModifiers.SHIFT_LEFT,
) -> Generator[Tuple[str, bool], None, None]:
assert shift_key in ["ShiftLeft", "ShiftRight"]
assert shift_key in WebModifiers.SHIFTS
shifted = False
for ch in text: