Skip to content

Commit a70a038

Browse files
authored
Merge branch '26.eap' into santo/26.eap11/user-agent-os1
2 parents c96500c + a08ec55 commit a70a038

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

starboard/contrib/rdk/src/third_party/starboard/rdk/shared/BUILD.gn

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ if (rdk_enable_ocdm) {
108108

109109
group("starboard_platform") {
110110
public_deps = [ ":starboard_platform_sources" ]
111+
data_deps = [ ":rdk_cobalt_content" ]
111112
}
112113

113114
static_library("starboard_platform_sources") {
@@ -371,3 +372,12 @@ static_library("starboard_platform_sources") {
371372
deps = [ "//third_party/llvm-project/libunwind:unwind_starboard" ]
372373
}
373374
}
375+
376+
group("rdk_cobalt_content") {
377+
data_deps = [ ":rdk_cobalt_keymap($default_toolchain)" ]
378+
}
379+
380+
copy("rdk_cobalt_keymap") {
381+
sources = [ "cobalt/content/etc/keymapping.json" ]
382+
outputs = [ "$root_out_dir/app/cobalt/content/etc/keymapping.json" ]
383+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"description": "This struct overrides default key mapping (Lima M1 RDK, t4h) at runtime without rebuilding Cobalt. Use for testing or another remote.",
3+
"keymappings": [
4+
{
5+
"description": "OK/SELECT (KEY_SELECT=353)",
6+
"keycode": 353,
7+
"mapped": {
8+
"keycode": 28
9+
}
10+
},
11+
{
12+
"description": "Escape/Back (remote sends KEY_BACKSPACE=14)",
13+
"keycode": 14,
14+
"mapped": {
15+
"keycode": 1
16+
}
17+
}
18+
]
19+
}

starboard/contrib/rdk/src/third_party/starboard/rdk/shared/linux_key_mapping.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ struct LinuxKeyMappingImpl {
131131
SbKeyModifiers mapped_modifiers;
132132
};
133133

134+
// Default mapping for the Lima M1 RDK remote (t4h). It can be overridden at
135+
// runtime via keymapping.json ($COBALT_CONTENT_DIR/app/cobalt/content/etc/keymapping.json)
136+
// without rebuilding Cobalt—e.g. for testing or to use a different remote.
134137
std::vector<KeyMapping> key_mappings_ = {
135138
{ KEY_M, kSbKeyModifiersCtrl, KEY_UNKNOWN, kSbKeyModifiersNone }, // Menu
136139
{ KEY_G, kSbKeyModifiersCtrl, KEY_UNKNOWN, kSbKeyModifiersNone }, // Guide
@@ -159,6 +162,8 @@ struct LinuxKeyMappingImpl {
159162

160163
{ KEY_PAGEDOWN, kSbKeyModifiersNone, KEY_NEXTSONG, kSbKeyModifiersNone },
161164
{ KEY_PAGEUP, kSbKeyModifiersNone, KEY_PREVIOUSSONG, kSbKeyModifiersNone },
165+
{ KEY_BACKSPACE, kSbKeyModifiersNone, KEY_ESC, kSbKeyModifiersNone },
166+
{ KEY_SELECT, kSbKeyModifiersNone, KEY_ENTER, kSbKeyModifiersNone },
162167
};
163168

164169
void UpdateKeyMapping(

0 commit comments

Comments
 (0)