Howdy, Stranger!

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

Supported by

Working with keyboard in coroutine

Hi there!

Here is a part in my experiment which doesn't work.

for a reason i'm not fully understand the variable "response_KeyboardPre" is always None.

this is how the keyboard is configured:

The "Time" variable is coming from the loop "TimeLoop" and varied from trial to trial.

help please?

Comments

  • Hi,

    Right now, you've specified that KeyboardPre ends after 0 ms :smile:. If you set the End Time to [Time]. you will find that it collects key presses for the duration of the coroutines.

    Cheers,
    Sebastiaan

  • Thank you Sebastiaan so much!

    Now the "response_KeyboardPre" is updating and yet it doesn't recognize correct response when I press 'g' (please see the configurations in my picture above). what am I doing wrong?

    Thanks!

  • Hi,

    Are you sure it doesn't work? I just quickly copied your settings and tried myself, and it seems to work.
    .
    Maybe you need to remove the "" around the allowed_keys, like that f;g;h

    You know?

    Buy Me A Coffee

  • edited June 2017

    Buy Me A Coffee

  • Hey eduard,

    Thank you very much for your help!

    Unfortunately it doesn't work for me. I couldn't find any way in which I use two buttons for correct response and the variable "correct_KeyboardPre" is giving 1.

    maybe the problem is in my computer?
    Though it's really basic, I'm attaching my file here as I'm really don't know what to do..

  • Hey,

    Nope, your computer is fine. The problem is that Opensesame can't handle two keys being passed as correct_response. I don't think this is intended, right @sebastiaan? As far as I remember it did work in the past, though?

    At any rate, until this is fixed (in case it will be fixed), you can compute your accuracy yourself. It's quite simple:


    correct_keys = ['f','g'] if response in correct_keys: correct = 1 else: correct = 0

    Hope this helps.

    Eduard

    Buy Me A Coffee

  • I don't think this is intended, right @sebastiaan? As far as I remember it did work in the past, though?

    No that never worked. But clearly it would be convenient, so I opened an issue for it.

    Regarding the code, don't forget the var. before response!

    correct_keys = ['f','g']
    correct = 1 if var.response in correct_keys else 0
    

    Cheers!
    Sebastiaan

  • Thank you Sebastiaan and Eduard!!!

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