Skip to content

Commit

Permalink
New screen identifier script
Browse files Browse the repository at this point in the history
This will ultimately get rolled into the builder, but it's a simple script for identifying which physical screen has which screen index.
  • Loading branch information
jfkominsky committed Dec 8, 2019
1 parent 40db085 commit 3123290
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PyHab/PyHabClassHPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def SetupWindow(self):
:rtype:
"""
if self.stimPres:
# Stimulus presentation window
# Stimulus presentation window
self.win = visual.Window((self.screenWidth['C'], self.screenHeight['C']), fullscr=False, screen=self.screenIndex['C'], allowGUI=False,
units='pix', color=self.screenColor['C'])
self.winL = visual.Window((self.screenWidth['L'], self.screenHeight['L']), fullscr=False, screen=self.screenIndex['L'], allowGUI=False,
Expand Down
27 changes: 27 additions & 0 deletions ScreenIdentifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from psychopy import visual, event, core, gui, monitors, tools, sound,__version__
from psychopy.app import coder
import wx, random, csv, shutil, os, sys, threading, itertools
from math import *
from copy import deepcopy
import pyglet

"""
A simple tool for identifying which screen has which screen index
"""

defDisp = pyglet.window.get_platform().get_default_display()
allScrs = defDisp.get_screens()

screenList = list(range(0, len(allScrs)))
winList = []

for i in range(0, len(screenList)):
tmpWin = visual.Window(size=(400,300), pos=(0,0),units='norm',screen=screenList[i])
tmpTxt = visual.TextStim(tmpWin, text=str(screenList[i]), pos=(0,0))
tmpTxt.draw()
tmpWin.flip()
winList.append(tmpWin)

event.waitKeys()
for j in range(0, len(winList)):
winList[j].close()

0 comments on commit 3123290

Please sign in to comment.