Howdy, Stranger!

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

Supported by

keyboard presses before their time

Hi,
I would like to know how to ignore keyboard presses that happened before the keyboard input of the sketchpat (I think that this is what "Flush key pending events" does for the keyboard_response item)
I have a sketchpad A that lasts 2 minutes and then another sketchpad B with duration sets to "keypress". I noticed that if you press something during the sketchpad A, after the two minutes the sketchpad B gets skipped. How can I make that sketchpad B ignores the keyboard presses of sketchpad B?

Thanks,
Bruno

Comments

  • Hi Bruno,

    The easiest way is probably to set the duration of the sketchpad to 0, and then use a keyboard_response to wait for the keypress.

    Cheers!
    Sebastiaan

    Buy Me A Coffee

  • Thanks for the fast answer, but it's still not working. I'm attaching a minimal example, if you press anything during the "wait" sketchpad, then the "press" sketchpad gets skipped.

    Bests,
    Bruno

  • Right, I see. You can add a keyboard_response with a 0 ms timeout between the two sketchpads. That will flush pending key presses but not actually wait for a key press.

    Buy Me A Coffee

  • Do you mean like this? It's still not working correctly.

  • HI Bruno,

    Yes exactly. Are you running on Linux (or perhaps Mac OS)? For some reason flushing doesn't work there, but I'm not sure why. On Windows it will.

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • Hey guys,

    It is reminding me a little bit the issue I had there but with mouse response:
    http://forum.cogsci.nl/index.php?p=/discussion/4028/reseting-mouse-position-between-mouse-responses#latest

    Another way to fix it would be to create a ghost keyboard response between sketchpad.
    Just tried it on OSX and it works apparently (see the file).

    Best,

    Sylvain

  • Hi,
    I'm using Linux (and also the experiment is running in Linux). Sylvain's workaround didn't work either. Any other ideas?

  • sorry to bother with this, but what can I do besides putting a "don't press anything" in the waiting sketchpad?

  • Hi Bruno,

    It took me a while to figure this out, but it's fixed in the latest prerelease of 3.2.5 (now 3.2.5.a6). You can update through pip or, if you're running Ubuntu, through ppa:smathot/opensesame-kuhn.

    Alternatively, you can simply insert the following inline_script at places where you want to force the flush from happening:

    import pygame
    pygame.event.pump()
    

    Cheers!
    Sebastiaan

    Buy Me A Coffee

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