From c3e3e1e98379e8c08b3cbc39aca750551dbee30e Mon Sep 17 00:00:00 2001 From: yunfeibai Date: Wed, 10 May 2017 15:33:58 -0700 Subject: [PATCH] modify vr button log parse example --- examples/pybullet/examples/dumpLog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pybullet/examples/dumpLog.py b/examples/pybullet/examples/dumpLog.py index 35659ef19..0fe87cdf0 100644 --- a/examples/pybullet/examples/dumpLog.py +++ b/examples/pybullet/examples/dumpLog.py @@ -93,11 +93,11 @@ for record in log: for packedButtonIndex in range(firstPackedButtonIndex, firstPackedButtonIndex+numPackedButtons): for packButtonShift in range(numGroupedButtons): buttonEvent = buttonMask & record[packedButtonIndex] - if buttonEvent == 1: + if buttonEvent & 1: buttonDownIndices.append(buttonIndex) - elif buttonEvent == 2: + elif buttonEvent & 2: buttonTriggeredIndices.append(buttonIndex) - elif buttonEvent == 4: + elif buttonEvent & 4: buttonReleasedIndices.append(buttonIndex) record[packedButtonIndex] = record[packedButtonIndex] >> 3 buttonIndex += 1