Hi,
I am trying to set the computer’s mouse to a specific location using iohub (e.g., (0, -198)). The mouse is appearing at the location with the opposite y-value s.t. the mouse would appear at (0, 198) instead of (0, -198). However, the log data states that the mouse is at (0, -198) until it is moved, after which the log file recognizes the mouse is on the positive y-axis. I have searched my code, and it is not an issue with my code itself. I also have a black circle that is set to the same location as the mouse, and it does in fact appear at (0, -198) instead of (0, 198). Thus, I am pretty sure that the issue is not an error with how I am setting the position.
I have attached some code below that shows the issue. The code will print the position of the mouse so you can see that the mouse position will only register as (0, 198) after it has been moved, but the mouse does begin at (0, 198) instead of (0, -198). I have also attached images of the code and output, in case you cannot reproduce it on your computer.
Is this a known bug, or is there some kind of work-around that you can think of? It seems to be a systems error or Psychopy/iohub error, but I am not sure how to approach the issue. Note, I am using macOS Big Sur with an intel i7 processor. Any help would be greatly appreciated. Thank you!
~Iyla
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from psychopy.iohub import launchHubServer
from psychopy.iohub import devices
from psychopy import visual
io = launchHubServer()
mouse = io.devices.mouse
keyboard = io.devices.keyboard
win = visual.Window(
size=(1440,900), fullscr=True, screen=0,
winType='pyglet', allowGUI=False, allowStencil=False,
monitor='testMonitor', color=[0,0,0], colorSpace='rgb',
blendMode='avg', useFBO=True,
#useRetina=True,
units='pix')
cursor = visual.Circle(win, radius=5, edges=32, units='pix', pos=(0, -198), fillColor='black', autoDraw=True, autoLog=True, name='cursor')
mouse.setPosition(cursor.pos)
while len(keyboard.getEvents())==0:
if len(mouse.getEvents()) > 0:
print('---------------------- \nmouse event occurred \n----------------------')
cursor.draw()
print(mouse.getPosition())
win.flip()
win.close()
io.quit()