# KbCheck in while loop - recording button presses several times

**URL:** <https://psychtoolbox.discourse.group/t/kbcheck-in-while-loop-recording-button-presses-several-times/4135>\
**Category:** Programming Help\
**Tags:** experiment-design, timing\
**Created:** [November 22, 2021, 2:28pm UTC](https://psychtoolbox.discourse.group/t/kbcheck-in-while-loop-recording-button-presses-several-times/4135 "2021-11-22T14:28:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [November 23, 2021, 8:02pm UTC](https://psychtoolbox.discourse.group/t/kbcheck-in-while-loop-recording-button-presses-several-times/4135/4 "2021-11-23T20:02:54Z")

</div>

Diedericks advice is th correct one.

Btw. your priority support is used up, as the question you asked a while ago already exceeded the 60 minutes of total time contingent, clocking in at 73 minutes. You’d have to buy a new license for further support by myself.

Also, relating to your old audio question: You could `UpdatePsychtoolbox` to PTB 3.0.18. It had some improvements to the PsychPortAudio sound driver, which may be able to work around macOS audio volume deficiencies. Seemed to work on my Catalina MBP 2017, maybe it also helps on yours.

For reference, this was the verdict under PTB 3.0.17 + macOS:

> [@Audio volume does not change](https://psychtoolbox.discourse.group/t/audio-volume-does-not-change/4026/4):
>
> I tested your script now on Linux, Windows-10 and macOS 10.15.7. Your script works just fine on Linux and Windows. It’s yet another macOS screwup. I get the same, essentially almost no perceptible change in loudness. I think macOS is normalizing whatever signal amplitude it gets from our driver to some standard amplitude, rescaling the signal accordingly, thereby undoing the volume change. You can hear it if you set Volume to zero, where it indeed turns silent. Or if you use BasicAMAndMixSche…

-mario

---

_[View the full topic](https://psychtoolbox.discourse.group/t/kbcheck-in-while-loop-recording-button-presses-several-times/4135)._
