Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

examples: how to map the MOOQ0's Input button (KEYCODE_MEDIA_RECORD) (#1368)

Gathin23201f61274065
diff --git a/examples/README.md b/examples/README.md
index 8bcea243f..3ae59ecb5 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -271,7 +271,7 @@ on that firmware, grouped and commented. These are starting points: comment out
| `xiaomi-mi-box-s/` | Xiaomi Mi Box S (MIBOX4, oneday), streaming box | Android TV 9 | PatchWall, Mi analytics, Alphonso ad tracking, MiLink; voice, casting, phone remote off by choice; second unit: Apps button opens Home with HomeKeyService; fourth unit: LumiFlow device theme, casting and voice kept; [notes](../docs/devices/xiaomi-mi-box-s.md) |
| `xiaomi-mi-box-s-android12/` | Xiaomi Mi Box S (MIBOX4, oneday), streaming box, Android 12 update | Android TV 12 | PatchWall, Mi channels and Mi TV+, Mi analytics and stats uploader, web promos, recommendations, MiLink and Xiaomi screensaver off; Chromecast, voice and updater kept; [remote and buttons](xiaomi-mi-box-s-android12/README.md) |
| `xiaomi-mi-box-s-2nd-gen/` | Xiaomi Mi Box S 2nd gen (MiTV-AFKR0, jaws), streaming box | Google TV 11 | Mi ad row and PatchWall, Mi analytics, partner auto-installs, update service off by choice; setup wizard off for the launcher, Wi-Fi password re-entry note |
-| `xiaomi-mitv-mooq0/` | Xiaomi Mi TV (MiTV-MOOQ0, croods; includes P1 43" EU variant) | Android TV 10 and 11 | PatchWall, Mi analytics, MiChannel, TV Manager, Alexa bridge; factory test app also claims HOME; selected list entries applied on Android TV 11, optional apps kept, and Netflix boot behavior: [device notes](../docs/devices/xiaomi-mitv-mooq0-android11.md); notes from #81 |
+| `xiaomi-mitv-mooq0/` | Xiaomi Mi TV (MiTV-MOOQ0, croods; includes P1 43" EU variant) | Android TV 10 and 11 | PatchWall, Mi analytics, MiChannel, TV Manager, Alexa bridge; factory test app also claims HOME; selected list entries applied on Android TV 11, optional apps kept, and Netflix boot behavior: [device notes](../docs/devices/xiaomi-mitv-mooq0-android11.md); the remote's Input button sends `KEYCODE_MEDIA_RECORD`, so the header shows how to map it (#1368); notes from #81 |
| `xiaomi-mi-tv-4a/` | Xiaomi Mi TV 4A (MiTV-MOOQ1) | Android TV 10 | PatchWall, Mi analytics, SmartShare, MiLink |
| `xiaomi-mitv-mooq2/` | Xiaomi Mi TV P1 43" (MiTV-MOOQ2, croods) | Android TV 11 | Same croods chassis as MOOQ0, Latin America unit: PatchWall, Mi analytics, MiChannel, Xiaomi TV+, TV Manager, Alexa bridge, partner auto-installs, factory menu; voice and USB media off by choice; `overseaservice` (Netflix key), Chromecast, Miracast and updater kept; setupwraith does not claim HOME |
| `xiaomi-mitv-aesp0/` | Xiaomi MiTV-AESP0 stick (aquaman, 1 GB) | Android TV 9 | No inputs; Home key sends ALL_APPS, needs `HOME_KEY_SERVICE=1` (a French unit's remote sent HOME); Chromecast kept; the Netflix key (1001) cannot be remapped without root; only the Developer options master switch closes 5555 |
diff --git a/examples/xiaomi-mitv-mooq0/debloat.txt b/examples/xiaomi-mitv-mooq0/debloat.txt
index 773503e59..b3aa1108c 100644
--- a/examples/xiaomi-mitv-mooq0/debloat.txt
+++ b/examples/xiaomi-mitv-mooq0/debloat.txt
@@ -4,13 +4,21 @@
# Also applied cleanly on firmware QTG3.200305.006.5135 (Vietnam retail unit, 2026-10): every package
# here disabled the same, and the "optional, by choice" mirroring/media apps below were additionally
# disabled (wfdsinkhelperservice, milinkservice, smartshare, mitvplus, videos, youtube.tvmusic,
-# mediaexplorer, videoplayer) with Netflix/YouTube/VieON still playing afterwards. On that unit the
-# remote's Input/Source button sends KEYCODE_MEDIA_RECORD (kernel KEY_RECORD), not KEYCODE_TV, so
-# InputKeyService does not catch it by default. To make the button open the launcher's Inputs menu, list
-# 130 (KEYCODE_MEDIA_RECORD) in input_key_keycodes and turn handle_view_inputs on (config.xml, or
-# "input_key_keycodes": [130], "handle_view_inputs": true in a theme's config.json), then build with
-# INPUT_KEY_SERVICE=1. Checked on the firmware 5135 unit: pressed inside another app, the button opens
-# the launcher's Inputs menu (Home comes to the front first).
+# mediaexplorer, videoplayer) with Netflix/YouTube/VieON still playing afterwards.
+#
+# ---- The remote's Input/Source button (#243, #1368) ----
+# It sends KEYCODE_MEDIA_RECORD (130, kernel KEY_RECORD), not KEYCODE_TV, so after the handover it does
+# nothing until the launcher is told to answer it. Either of these, in config.xml or a theme's config.json:
+# - "input_key_keycodes": [130] and "handle_view_inputs": true, built with INPUT_KEY_SERVICE=1. Checked on
+# the firmware 5135 unit: pressed inside another app, the button opens the launcher's Inputs menu (Home
+# comes to the front first).
+# - "app_keys": ["KEYCODE_MEDIA_RECORD:inputs"], with either key helper (HOME_KEY_SERVICE=1 or
+# INPUT_KEY_SERVICE=1). The "inputs" target opens the launcher's own Inputs menu directly, so
+# handle_view_inputs is not needed. Read from the launcher code (RemoteKeys), not yet tried on a MOOQ0.
+# Keep com.mediatek.hotkey.dispatcher enabled (it is in the keep list below): if `pm list packages -d`
+# shows it, `pm enable com.mediatek.hotkey.dispatcher`. Other app buttons (Netflix, Prime Video) are mapped
+# the same way, as "<keycode>:<package>" in app_keys; `getevent -l` shows what a button sends. Test with the
+# real remote: `input keyevent` skips the key helpers.
#
# ---- Android TV 11 variant: Xiaomi Mi TV P1 43" (MiTV-MOOQ0, croods, EU) ----
# Firmware RTM4.220307.164.8835 (2026-10). The selected subset was applied and the TV remained
diff --git a/examples/xiaomi-mitv-mooq0/tv.json b/examples/xiaomi-mitv-mooq0/tv.json
index feb2e447b..c3f366e10 100644
--- a/examples/xiaomi-mitv-mooq0/tv.json
+++ b/examples/xiaomi-mitv-mooq0/tv.json
@@ -2,5 +2,5 @@
"tv": "Xiaomi Mi TV (MiTV-MOOQ0, croods; includes P1 43\" EU variant)",
"os": "Android TV 10 and 11",
"brand": "Xiaomi",
- "notes": "PatchWall, Mi analytics, MiChannel, TV Manager, Alexa bridge; factory test app also claims HOME; selected list entries applied on Android TV 11, optional apps kept, and Netflix boot behavior: [device notes](../docs/devices/xiaomi-mitv-mooq0-android11.md); notes from #81"
+ "notes": "PatchWall, Mi analytics, MiChannel, TV Manager, Alexa bridge; factory test app also claims HOME; selected list entries applied on Android TV 11, optional apps kept, and Netflix boot behavior: [device notes](../docs/devices/xiaomi-mitv-mooq0-android11.md); the remote's Input button sends `KEYCODE_MEDIA_RECORD`, so the header shows how to map it (#1368); notes from #81"
}