From f371ba9ff04d6141827f911be77db196ad5d7fa7 Mon Sep 17 00:00:00 2001 From: iwalker <1043309958@qq.com> Date: Tue, 3 Nov 2026 06:32:19 +0800 Subject: [PATCH] Clink: map Android media play/pause keycodes 126/127 to play/pause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Carlink key mapping only recognized KEYCODE_MEDIA_PLAY_PAUSE (85) as the play/pause key. Head units that send KEYCODE_MEDIA_PLAY (126) or KEYCODE_MEDIA_PAUSE (127) — as XPeng's steering wheel does — were silently dropped. Map all three to KeyCode.PLAY_PAUSE, matching CarPlayMediaButton's existing BYD mapping, so the relay can forward them as a CarPlay toggle. --- .../main/kotlin/org/openxplay/stream/clink/uibc/UibcDecoder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlin/clink/src/main/kotlin/org/openxplay/stream/clink/uibc/UibcDecoder.kt b/kotlin/clink/src/main/kotlin/org/openxplay/stream/clink/uibc/UibcDecoder.kt index a5830d6..d80aed7 100644 --- a/kotlin/clink/src/main/kotlin/org/openxplay/stream/clink/uibc/UibcDecoder.kt +++ b/kotlin/clink/src/main/kotlin/org/openxplay/stream/clink/uibc/UibcDecoder.kt @@ -103,7 +103,7 @@ public class UibcDecoder(private val origin: Origin, private val streamSize: () val code = when (androidCode) { 3 -> KeyCode.HOME; 4 -> KeyCode.BACK; 23, 66 -> KeyCode.SELECT 19 -> KeyCode.KNOB_UP; 20 -> KeyCode.KNOB_DOWN; 21 -> KeyCode.KNOB_LEFT; 22 -> KeyCode.KNOB_RIGHT - 85 -> KeyCode.PLAY_PAUSE; 87 -> KeyCode.NEXT; 88 -> KeyCode.PREVIOUS; 231 -> KeyCode.VOICE + 85, 126, 127 -> KeyCode.PLAY_PAUSE; 87 -> KeyCode.NEXT; 88 -> KeyCode.PREVIOUS; 231 -> KeyCode.VOICE else -> return null } if (action == 2) return null // ACTION_MULTIPLE has no down/up equivalent.