Kodi Community Forum

Full Version: Conditional animations both triggered under certain circumstances?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a different way to do this? Most of the time if I select an item far enough to the left that it causes a scroll, the next time I move to the right far enough to cause a scroll both animations get triggered. In the end I just need to make sure that the animation has a 200ms delay whenever we are scrolling.

Code:
<include name="RightEdgeWallViewFocusAnim">
<animation effect="zoom" start="100" end="175" time="200" condition="Container.Scrolling|Container.OnScrollPrevious|Container.OnScrollNext" delay="200">Focus</animation>
<animation effect="zoom" start="100" end="175" time="200" condition="!Container.Scrolling">Focus</animation>
</include>

This is the relevant debug log. You can see that the last "right" button press has a different scancode, sym, and unicode.

Code:
20:46:57 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:57 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:57 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:57 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:57 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:57 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:57 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:57 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:57 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:58 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:58 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:58 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:58 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:58 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:58 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:58 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:58 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:59 T:6960   DEBUG: Keyboard: scancode: 0x4b, sym: 0x0114, unicode: 0x0000, modifier: 0x0
20:46:59 T:6960   DEBUG: CApplication::OnKey: left (0xf082) pressed, action is Left
20:46:59 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:46:59 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:46:59 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:46:59 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:46:59 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:46:59 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:00 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:00 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:00 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:00 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:00 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:00 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:00 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:00 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:00 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:00 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:01 T:6960   DEBUG: Keyboard: scancode: 0x4d, sym: 0x0113, unicode: 0x0000, modifier: 0x0
20:47:01 T:6960   DEBUG: CApplication::OnKey: right (0xf083) pressed, action is Right
20:47:04 T:6960   DEBUG: Keyboard: scancode: 0x01, sym: 0x001b, unicode: 0x001b, modifier: 0x0
I managed to fix it by adding a row and column check to the second animation:

Code:
<animation effect="zoom" start="100" end="175" time="200" condition="[Container.Column(8) + Container.Row(0)] + !Container.Scrolling">Focus</animation>

Apparently if my panel is wider than the screen (in order to have an item selected on the right edge without it scrolling) it causes problems with the scrolling logic.
Never mind, that didn't fix shit. It just makes it so that I have to press left 5 times and then go back right.