Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework RemoteController key handling #1092

Merged
merged 7 commits into from
Aug 11, 2024

Conversation

wutschel
Copy link
Collaborator

Description

Closes #427.

This PR does some internal rework of how RemoteController handles key presses and touch pad events.

Refactoring of key processing

Refactoring the processing of keys into two main methods processButtonPress and processButtonLongPress. Only in these methods key presses and interpreted and commands are sent to Kodi. This allowed to reduce some distributed preparation and calling of JSON API commands.

Up/Down/Left/Right to match physical keyboard

Introducing "Input.ButtonEvent" (supported since Kodi 19) for the up/down/left/right buttons to match the behaviour of pressing the same on a physical keyboard. This resolves an issue where seek was behaving different while playing videos with and without the progress slider being visible.

Remark: This now results in different behaviour between Kodi versions "older than 19" and "19 or later". Also the remote buttons behave different now for music playback compared to older App versions: Up/Down = Next/Previous (instead of rating up/down) and Left/Right = Seek backward/forward. This matches behaviour of keyboard presses.

Rewriting auto-repeated key presses

The auto-repeating key presses are rewritten (similar to how this is done for volume button presses). This allows to reduce complexity and a global variable.

Summary for release notes

Maintenance: Internal refactoring of remote control button processing
Improvement: Consistent up/down/left/right behaviour of remote and physical keyboard

Using Input.ButtonEvent allows to have consistent seek/skip behaviour between remote app and keyboard. This JSON command is only supported since API 12 (Kodi 19). For older API version the processing is unchaged.
The method processButtonPress now holds the processing of all possible (non-longpressed) button presses. To ease up the exception handling for left/right/up/down key presses during fullscreen two virtual keys for big seek steps are introduced.
The exception handling for up/down/left/right button presses for older Kodi version shall match the behaviour of using keyboard or Input.ButtonEvent. This impacts the music playback as now key up/down results in next/previous and left/right in seek forward/backward. The rating increase/decrease is not supported anymore.
Use timer parameter instead of global variable to identify the repeated button. Use same 0.5 sec timeout for both key/touch remote before starting auto-repeat. Use 0.1 sec for auto-repeating. Rename timer ivar to match its function.
@kambala-decapitator kambala-decapitator merged commit 2727234 into xbmc:master Aug 11, 2024
@wutschel wutschel deleted the fix_seek_on_info branch August 11, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Skip Steps to be configurable
2 participants