Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Recentre the mouse in each loop iteration

edited August 2015 in OpenSesame

I have a custom form, generated with a Python inline script, that runs as the main part of my loop. In each iteration, the mouse position does not change. I would like it to reset to the centre of the screen (when in fullscreen mode) on each iteration.

I've tried this (where mouse has been imported):

myMouse = mouse(exp)
myMouse.set_pos((0,0))

...I also tried myMouse.set_pos(pos=(exp.get("width")/2, exp.get("height")/2), per the answer to this question.

Neither of them worked (using the Legacy backend)... Any ideas?

Thanks;
C

Comments

  • edited 1:50AM

    (n.b., the set_pos call does work when running in windowed mode.)

  • edited 1:50AM

    ...Following a short discussion on StackOverflow, I tried to see what get_pos was returning both before and after the call to set_pos. Weirdly, get_pos is returning the expected coordinates, it's just that the actual pointer on the screen doesn't move.

    To add to the weirdness: My experiment consists of two tasks. The task in question is exhibiting this non-resetting position behaviour in fullscreen mode; however, the other task does reset the mouse position in every loop iteration (without me explicitly telling it to). The other task is not that different, in terms of structure; it just has an extra Python script that draws to the canvas. I tried adding a similar item to the non-resetting task -- which just shows and clears the canvas -- but all that did was make the screen flash and the pointer still doesn't move!

    This forum post suggests that playing with set_visible will have an effect. So far, all this has done for me is make the pointer flash briefly. (That said, I've been using myMouse.set_visible, rather than self.mouse.set_visible. I don't suppose that will make a difference, but I'll try the latter this evening...)

    Thanks;
    C

  • edited 1:50AM

    Hi,

    Setting the mouse position is a tricky business. As far as I can tell, it works differently on different system--but rarely as expected.

    I cannot say much more than I already did in the forum post that you're linking to. But what you could try is playing with the back-end settings. For example, what happens if you disable/ enable double buffering or hardware surface?

    Cheers,
    Sebastiaan

  • edited 1:50AM

    No luck, I'm afraid... Thanks, all the same :)

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games