Repository navigation
Clink: map Android media play/pause keycodes 126/127 to play/pause - #31
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UibcDecoder.key()only recognizedKEYCODE_MEDIA_PLAY_PAUSE(85) as theplay/pause key. Head units that send
KEYCODE_MEDIA_PLAY(126) orKEYCODE_MEDIA_PAUSE(127) — as XPeng's steering wheel does — were silentlydropped (the mapping fell through to
else -> null).Change
Map 85, 126 and 127 all to
KeyCode.PLAY_PAUSE, matching the existingCarPlayMediaButton.forKeyCodemapping already used on the DiPlay/BYD side(which treats
KEYCODE_MEDIA_PLAY,KEYCODE_MEDIA_PAUSEandKEYCODE_MEDIA_PLAY_PAUSEas the toggle).Pure additive: keycode 85 is unchanged.
Verification
steering-wheel key; the head unit sends
code=126on key-down.ControlEvent.Key.media key code=PLAY_PAUSE index=3 sent=trueand thephone toggles play/pause.
Note for maintainers
This is a dependency of a follow-up Relay PR that forwards steering-wheel
media keys. It does not depend on the open PR #30 (audio PTS anchor); it only
touches
UibcDecoder.kt.