mirror of
https://github.com/lowobservable/oec.git
synced 2026-03-05 02:54:50 +00:00
Add MODIFIER_KEYS
This commit is contained in:
@@ -281,6 +281,8 @@ KEY_MODIFIER_MAP = {
|
||||
Key.CAPS_LOCK: KeyboardModifiers.CAPS_LOCK
|
||||
}
|
||||
|
||||
MODIFIER_KEYS = set(KEY_MODIFIER_MAP.keys())
|
||||
|
||||
Keymap = namedtuple('Keymap', ['name', 'default', 'shift', 'alt', 'modifier_release'])
|
||||
|
||||
class Keyboard:
|
||||
|
||||
@@ -11,7 +11,7 @@ import pyte
|
||||
|
||||
from .session import Session, SessionDisconnectedError
|
||||
from .display import encode_ascii_character
|
||||
from .keyboard import Key, get_ascii_character_for_key
|
||||
from .keyboard import Key, get_ascii_character_for_key, MODIFIER_KEYS
|
||||
|
||||
VT100_KEY_MAP = {
|
||||
Key.NOT: b'^',
|
||||
@@ -130,8 +130,7 @@ class VT100Session(Session):
|
||||
if keyboard_modifiers.is_alt():
|
||||
# Ignore any modifiers... this would fall through and result in a warning
|
||||
# if they are not explicitly ignored.
|
||||
if key in [Key.LEFT_ALT, Key.RIGHT_ALT, Key.LEFT_SHIFT, Key.RIGHT_SHIFT,
|
||||
Key.CAPS_LOCK]:
|
||||
if key in MODIFIER_KEYS:
|
||||
return None
|
||||
|
||||
bytes_ = VT100_KEY_MAP_ALT.get(key)
|
||||
|
||||
Reference in New Issue
Block a user