Use keyup/keydown ECP commands instead of keypress for a smoother operation.#45
Open
pupitetris wants to merge 11 commits intowseemann:masterfrom
Open
Use keyup/keydown ECP commands instead of keypress for a smoother operation.#45pupitetris wants to merge 11 commits intowseemann:masterfrom
pupitetris wants to merge 11 commits intowseemann:masterfrom
Conversation
instead of onclick + keypress. This allows for a smoother control for situations where holding a button down is handled (as a test case, check the Retaliate Roku Game).
instead of onclick + keypress. This allows for a smoother control for situations where holding a button down is handled (as a test case, check the Retaliate Roku Game, or scrolling through videos on YouTube and moving through a video replay). Even the main Roku menu uses rew/ff buttons as PgUp/PgDn alternatives to skip options by screenfulls, and changing the behaviour of the buttons here has an impact too. Same case for back in standard navigation. So, this is the only behaviour for buttons that emmit key events now.
with a fallback for old platform versions. Also, new private getVibrator and code factorization to avoid repetition between the new provideHapticEffect and provideHapticFeedback.
to allow for haptic feedback just as the button is touched instead of at the end on the click process, and to allow for the click process to be prevented so that finer keyup and keydown commands can be sent to the Roku while preventing a duplicitous keypress to be sent at the end of the interaction. A click/keypress can still be used in case the button is "clicked" by different means than touch input. VIBRATE_DURATION_MS reduced to 25ms, and provideHapticFeedback calls were replaced with provideHapticEffect with EFFECT_TICK for a more subtle vibration pattern.
with VibratingImageButton, as the RepeatingImageButton behaviour is no longer needed: finer keyup/keydown commands sent on touch events render the timed keypresses obsolete. All buttons, including the dpad can be implemented with VibratingImageButton directly.
RepeatingImageButton class no longer needed. All buttons have their listeners configured with linkButton, which sets up click and touch listeners.
just to respect the original order of the code.
as it doesn't make sense to do so, and this prevented special buttons such as Power from working
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I first noticed there was a problem with RoMote when trying the Retaliate game on Roku, but I've seen that it affects more common use cases, such as doing ff or rew while playing a video on YouTube or any other player, or navigating quickly on content collections.
This patch changes RoMote so that it sends keyup/keydown commands instead of single kepress commands every 400ms.
RepeatingImageButton class is no longer used and all remote buttons use VibratingImageButton, which was modified to listen to Touch events. Click events are still handled in case the buttons are clicked using a non-touch device.
Haptic vibrations were retouched a bit, allowing for the new Effects API to be used, with a gracious fallback for older devices. The vibration is now more subtle, as they are now produced using EFFECT_TICK.