mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
fix(input): hide on physical controller use only and refresh the kit when the virtual controller changes
This commit is contained in:
1 parent
318d64f3d6
commit
e67c185f13
3 files changed
+32
-3
No files matched your search
@@ -187,4 +187,15 @@ class InputSurfaceSourceTest {
|
||||
pad.update(0f, 0f)
|
||||
assertEquals("key:30:false", events.last())
|
||||
}
|
||||
|
||||
@Test fun onScreenInputNeverCountsAsAControllerInHand() {
|
||||
var physical = 0; var player = 0
|
||||
bridge.setOnPhysicalInput { physical++ }
|
||||
bridge.setOnPlayerInput { player++ }
|
||||
val stick = source(InputSurfaceElement(InputControl.LS, .1f, .1f, .3f, .3f, "legacy:ls", InputElementKind.STICK))
|
||||
stick.update(1f, 0f); stick.update(0f, 0f)
|
||||
org.robolectric.Shadows.shadowOf(android.os.Looper.getMainLooper()).idle()
|
||||
assertEquals(0, physical)
|
||||
assertTrue(player > 0)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user