X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/9096acac0bf12c658183483be6dc898db1a31756..a10fe6ac1c82bb34cbcb5d547448d99df1271650:/src/pywiiuse/pygame_wiimouse.py?ds=sidebyside diff --git a/src/pywiiuse/pygame_wiimouse.py b/src/pywiiuse/pygame_wiimouse.py index 4d42763..f77856c 100755 --- a/src/pywiiuse/pygame_wiimouse.py +++ b/src/pywiiuse/pygame_wiimouse.py @@ -127,18 +127,26 @@ class wiimote_thread(Thread): WT = None -def init(nmotes, timeout, screenResolution=(660, 370)): +def init(nmotes, timeout, screenResolution=(660, 370), position='ABOVE'): '''Initialize the module.''' global WT if WT: return WT = wiimote_thread(nmotes, timeout) + if position == 'ABOVE' : + position = wiiuse.IR_ABOVE + elif position == 'BELOW' : + position = wiiuse.IR_BELOW + else : + position = wiiuse.IR_ABOVE + + nmotes = get_count() for i in range(nmotes) : wm = Wiimote(i) # access the wiimote object wm.enable_accels(0) # turn off acceleration reporting - wm.enable_ir(1, vres = screenResolution, position=wiiuse.IR_BELOW) + wm.enable_ir(1, vres = screenResolution, position=position) def get_count():