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
Description
Closes https://github.com/xbmc/Official-Kodi-Remote-iOS/issues/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