Howdy, Stranger!

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

Supported by

[solved] Keypress carrying over to subsequent trials?

edited March 2014 in OpenSesame

Hi all, I'm having a bit of an issue with a program I've written (with some previous help here a good while ago). Here's a screenshot of the section in question:

image

What the loops are doing is recording two things concurrently. While in the Task_loop, it records a simple visual monitoring task (press a key to respond to a stimulus when it appears). At the same time, they'll be doing another task outside of the program (on a vehicle they'll be seated in). When the physical task is complete, the researcher presses "q", breaking the Task_loop and resetting "FMPower_loop" (in this case) with another set of physical instructions. Then it re-enters Task_loop to restart the visual monitoring task. Then it repeats until FMPower_loop is exhausted.

The problem I'm having is that after pressing q the first time, it never clears that keypress. So each time it goes back into Task_loop, it's immediately broken and just resets itself until the big loop is done. I have "Flush pending key presses" checked in every Sequence, and the keyboard response items are also checked to flush key presses. Is there something else I need to do to get this key to clear? Thanks in advance.

Comments

  • edited March 2014

    Hi!

    Assuming your break if statement is [response] = q, you could add a single line of code to your inline_script called inline_script in the sequence called Monitoring_Task:

    exp.set("response", None)
    

    That should do it!

    The reason why flushing the keyboard does not work, is because the variable response is set after a keypress, and is not changed until it is actively redefined (e.g. by another keyboard_response item). So actively changing response as we do with the line of code above should fix the problem.

    Good luck!

  • edited 6:03AM

    Ah, that worked perfectly! Thanks a bunch.

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