Rework RemoteController key handling #1092
Merged
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.
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
andprocessButtonLongPress
. 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