Benches MacBooks

2

USB or Keyboard Polling Rate

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi,

I am curious if anyone knows of a way of changing how often the internal keyboard or external USB keyboards are polled/sampled on a macbook. I would like to be able to sample from these devices at 1Khz (i.e. once per millisecond). Is there a straightforward way to do this? Many thanks!

Divyezheg

2 replies

Sign in or join Beachball Help to reply.

  1. 0

    impulse_telecom

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi,

    The OS X kernel is designed to be preemptable, so it is possible to possible to schedule a low-latency real-time thread that can run in a quasi-realtime deterministic manner.

    I have a feeling you're going to have to do some of the coding yourself to do what you want to do. This article, though old, gives some hints in sections 5.4 and 6:
    http://www.usenix.org/events/bsdcon/fullpapers/gerbarg/gerbarghtml/

    You might want to take a look at OS X programming relating to MIDI I/O since that requires accurate timing.

    Other things to keep in mind if you are measuring response times of someone pressing a key in response to a stimulus - what is your display's refresh rate and latency. Also, how deterministic is the keyboard scanning inside the keyboard? If your doing a psych experiment, using MIDI to trigger a stimulus presentation and read a button press may be the best way to get the timing accuracy you want.

  2. 0

    impulse_telecom

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    (Apologies for the re-post. My cat stepped on the keyboard and posted the previous article before I could make grammar corrections -Bill)

    Hi,

    The OS X kernel is designed to be preemptable, so it is possible to schedule a low-latency real-time thread that can run in a quasi-realtime deterministic manner.

    I have a feeling you're going to have to do some of the coding yourself to do what you want to do. This article, though old, gives some hints in sections 5.4 and 6:
    http://www.usenix.org/events/bsdcon/fullpapers/gerbarg/gerbarghtml/

    You might want to take a look at OS X programming relating to MIDI I/O since that requires accurate timing.

    Keep in mind when measuring response times of someone pressing a key in response to a stimulus: 1. What is your display's refresh rate and latency. 2. How deterministic is the keyboard scanning inside the keyboard? If your doing a psych experiment, using MIDI to trigger a stimulus presentation and read a button press may be an easy way to get the timing accuracy you want.

    -Bill