Safari annoying beep

URL of experiment: https://run.pavlovia.org/MJB/immanent-justice-v1-3/html/

Description of the problem:

I have noticed that when I run my experiment from Safari, each time the experiment waits for a key response to progress, there is an annoying beep when a correct response has been made.
This is not the case on local runs, nor when running in Chrome.

Any ideas what might cause this and how to turn it off?

Thanks
Marc

1 Like

No, but I can replicate that problem. Iā€™ve added it as an issue to be fixed. Will let you know. Damned browser differences!! grrr

2 Likes

Any update on this issue?
My experiment, when piloted, (https://pavlovia.org/naomilee/num-abb) does the same exact thing on Safari only! Any key press with a correct response is rewarded with the Mac error noise (funk.caf) :upside_down_face:

Thanks in advance!

Same here. It doesnā€™t happen on other Javascript-based experimental platforms, so it should be fixable. Maybe not high priority, since many people have Chrome installed on their notebooks anyhow?

Hi, I had the same problem and found a way around it by accident:

window.addEventListener("keydown", (event) =>
{
    event.preventDefault()
    event.stopPropagation()
    return false
})

Put something like this at the beginning of the experiment.

I actually wanted to prevent browsers from reacting to default keyboard shortcuts, because Firefox would use ā€˜backspaceā€™ to go back one site, and found the solution on this page (ā€œsee 2.3 Suppressing Default Event Handlingā€).
Hopefully, this will help some of you as well :slight_smile:

Hey @Marc_Buehner, @jlc, @naomileenaomi, @DanielKuroschHopfner, many thanks for flagging. As it happens, fullscreen mode Safari does indeed trigger the macOS bell on key press. I have now raised the issue on GitHub and appreciate your understanding while we work towards a permanent fix.

Any updates on this issue?
Thanks!

Hi @itreves36, would it be possible to send me a link to your code? I brought a fix in for this recently, which I then had to pull back from, because Safari latest no longer has this problem and as not all studies suffer from it, the workaround is best kept inside the JS boilerplate rathen than the PsychoJS library if that makes any sense, x

Hi, so I figured out that exiting fullscreen and then re-entering can get rid of the error noises. Hereā€™s my code as well (I temporarily set it to public):

Thanks!

Cool, thanks, let me take a look, x

Hi @itreves36, I see no TextBox components in your project, I believe if you drop the following in a JS-only Before Experiment tab in e.g. the beginCode routine, that should work,

window.addEventListener("keydown", onkeydown);

function onkeydown(keydownEvent) {
  keydownEvent.preventDefault();
}
1 Like

I tried doing this and it looks like I can no longer enter the participant form information at the beginning of the experiment using my keyboardā€¦

In that case you could either generate the participant information elsewhere (e.g. through the VESPR Study Portal) or try adding the code in Begin Experiment instead of Before.