Howdy, Stranger!

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

Supported by

How to record mouse clicks in excel with reaction time in psychopy or just python itself

edited March 2016 in Miscellaneous

I am writing a program to provide visual stimuli which are basically two tone mooney photos.

The location of the images are coming from a csv sheet, and being displayed one by one on the screen.

The images are divided in the category of face or object.

I want the user to left click if he thinks what he sees is a face and right click on a mouse if he thinks it is an object.

The left click should be recorded in an excel/csv sheet as a 'face' entry & 'right' click as an object entry. All individual participants data, should be saved in different tabs in the excel sheet.
Along with that, the response time when the click was done as soon as myWin.flip() was called, should be recorded in another column in milliseconds.

Please suggest.

Relevant code is below:

csv input for images

trials = data.TrialHandler(
trialList=data.importConditions('stimsv1.csv'),
nReps=1,
method= 'sequential')

if aTrial['type'] == 'face':

    try:

        windll.inpout32.Out32(0x0000D100, 1)
        myWin.flip()
        core.wait(0.01)
        windll.inpout32.Out32(0x0000D100, 0)

    except:
        print 'trigger issue found '


elif aTrial['type'] == 'object':

    try:

        windll.inpout32.Out32(0x0000D100, 2)

        myWin.flip()
        core.wait(0.01)
        windll.inpout32.Out32(0x0000D100, 0)

    except:
        print 'trigger issue found '
else:
    continue

Comments

  • edited 9:50PM

    Hi,

    Your plan is clear. Are you stuck at a specific point, or do you want us to tell you exactly how to do everything?

    In case of the latter, it may be best for you to do an OpenSesame tutorial first; see http://osdoc.cogsci.nl/tutorials/step-by-step-tutorial/

    Cheers

    Josh

  • edited March 2016

    Hi,

    I am only interested in knowing specifically, how to capture whether a left(defined as yes) or a right(defined as no) mouse clicks while the stimuli are shown, in an excel/csv sheet along with the difference in time from the myWin.flip() in milliseconds.

    Can you mention the code I need to write to capture these mouse clicks along with the time(ms). I want the code part & not using the GUI.

  • edited 9:50PM

    Hi,

    All information you need or on the documentation of the mouse object. Basically, you wait for a click of the left and the right mouse button separately, but in rapid succession (e.g. in a while loop with a timeout of 10 ms each). Use the keylist argument to sample only right, or left clicks. Once a response was given, check whether it was left or right, and based on that info you can assign proper values to your object/face/response time variables.

    Does this make sense?

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited February 2017

    The left click should be recorded in an excel/csv sheet as a 'face' entry & 'right' click as an object entry. All individual participants data, should be saved in different tabs in the excel sheet.

    Along with that, the response time when the click was done as soon as myWin.flip() was called, should be recorded in another column in milliseconds.

    sagarcog, did you get it fixed?

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