Skip to content

Commit

Permalink
BF: second fix for dual mouse objects following 0e0b26d
Browse files Browse the repository at this point in the history
  • Loading branch information
peircej committed Sep 6, 2020
1 parent 1758374 commit 32a6be2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions psychopy/experiment/components/mouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,16 +584,16 @@ def writeRoutineEndCodeJS(self, buff):

if store == 'final':

code = ("const xys = {name}.getPos();\n"
"const buttons = {name}.getPressed();\n")
code = ("_mouseXYs = {name}.getPos();\n"
"_mouseButtons = {name}.getPressed();\n")

if currLoop.type != 'StairHandler':
code += (
"psychoJS.experiment.addData('{name}.x', xys[0]);\n"
"psychoJS.experiment.addData('{name}.y', xys[1]);\n"
"psychoJS.experiment.addData('{name}.leftButton', buttons[0]);\n"
"psychoJS.experiment.addData('{name}.midButton', buttons[1]);\n"
"psychoJS.experiment.addData('{name}.rightButton', buttons[2]);\n"
"psychoJS.experiment.addData('{name}.x', _mouseXYs[0]);\n"
"psychoJS.experiment.addData('{name}.y', _mouseXYs[1]);\n"
"psychoJS.experiment.addData('{name}.leftButton', _mouseButtons[0]);\n"
"psychoJS.experiment.addData('{name}.midButton', _mouseButtons[1]);\n"
"psychoJS.experiment.addData('{name}.rightButton', _mouseButtons[2]);\n"
)
buff.writeIndentedLines(code.format(name=name))

Expand Down

0 comments on commit 32a6be2

Please sign in to comment.