forked from rbreaves/kinto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsourceos_binding.py
More file actions
49 lines (42 loc) · 1.77 KB
/
sourceos_binding.py
File metadata and controls
49 lines (42 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""SourceOS / SociOS keymap-profile binding helper for kinto.
This module intentionally stays small. It exposes the canonical keymap profile
metadata so kinto-side tooling or future runtime code can consume the shared
keyboard-navigation canon without making `kinto` the owner of that canon.
"""
from __future__ import annotations
from typing import Any
_KEYMAP_PROFILE: dict[str, Any] = {
'id': 'urn:srcos:keymap-profile:mac-linux-primary',
'name': 'Mac/Linux Primary Profile',
'platform': 'socios-linux',
'primaryModifierStrategy': 'mac-linux-primary',
'guiProfile': {
'physicalCtrl': 'Super',
'physicalAlt': 'Alt',
'physicalSuper': 'Ctrl',
},
'terminalProfile': {
'physicalCtrl': 'Ctrl',
'physicalAlt': 'Alt',
'physicalSuper': 'RightCtrl',
},
'launcherRefs': [],
'overlayRefs': ['urn:srcos:interaction-surface:shortcut-overlay'],
'remapEngineRef': 'urn:srcos:remap-engine:kinto',
'protectedNamespaces': ['terminal.pass-through', 'editor.insert', 'browser.text-field', 'accessibility'],
'evidenceRefs': [],
}
def get_sourceos_keymap_profile() -> dict[str, Any]:
"""Return the SourceOS keymap profile binding for kinto.
The returned object is a copy so callers can enrich it locally without
mutating the module-level canonical binding payload.
"""
return {
**_KEYMAP_PROFILE,
'guiProfile': dict(_KEYMAP_PROFILE['guiProfile']),
'terminalProfile': dict(_KEYMAP_PROFILE['terminalProfile']),
'launcherRefs': list(_KEYMAP_PROFILE['launcherRefs']),
'overlayRefs': list(_KEYMAP_PROFILE['overlayRefs']),
'protectedNamespaces': list(_KEYMAP_PROFILE['protectedNamespaces']),
'evidenceRefs': list(_KEYMAP_PROFILE['evidenceRefs']),
}