Howdy, Stranger!

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

Supported by

[solved] Monitoring keypresses throughout an experiment

edited January 2012 in OpenSesame

I just wanted to follow up from my bug report (https://github.com/smathot/OpenSesame/issues/53). I understand why you made the tradeoff in the design decision. However, is there some way to receive keyboard input during this time between trials? Essentially, the task I'm designing allows the participant to press a particular key at any time throughout the experiment so that, when a particular point in the next trial has been reached, this key can be acted upon. I feel like it should be possible with PyGame's event queue, though this doesn't seem to be accessible from inline scripts. Is there any way to detect if a particular keyboard key has been pressed within the last trial? It doesn't need to use the keyboard_response paradigm, though I've been using this as a hacky way of implementing what I have now.

Thanks!

Comments

  • edited October 2011

    Hi Max,

    Welcome to the forum!

    You can indeed use the PyGame event queue. Actually, the openexp.keyboard classes are just very thin wrappers. Around PyGame in the case of the legacy and opengl back-ends, around PsychoPy in the case of the psycho back-end.

    The reason why it doesn't work is that the keyboard is flushed before the start of each sequence (at the start of the run phase, more specifically). The idea behind this was that it allows the user to press escape to abort the experiment and to prevent carry-over effects from one trial to the next. But it's good that you bring it up, so I can make this behavior optional for the next release. I'll let you know when I committed a patch.

    But for now, no, there's no way you can do that. But I seem to remember that you run Linux, right? In that case you can just hack the source code. You can comment out "libopensesame/sequence.py" on line 42 in the run() method, and the flushing is gone. This file could be in "/usr/share/pyshared/libopensesame/" or "/usr/lib/pymodules/Python[version]/libopensesame/", depending on your method of installation.

    [Edit: I just found that there's also a flush in libopensesame/loop.py, line 145]

    libopensesame/sequence.py

    libopensesame/loop.py

    Hope this helps!

    Regards, Sebastiaan

  • edited 11:28PM

    Possible as of 0.25. Marking as solved.

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