Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include keydown event when unlocking audio #1417

Merged
merged 1 commit into from
May 16, 2021

Conversation

abrom
Copy link
Contributor

@abrom abrom commented Oct 27, 2020

To allow users with accessibility issues use our site we needed to support "unlocking" Howler using non-click/touch based events. The keydown event seemed the most appropriate.

I noticed there have been other discussions that have skirted around expanding on the existing list of events that trigger the unlock but I couldn't find anything concrete.

@oswaldofreitas mentioned in #1294 about using:

  'click',
  'contextmenu',
  'auxclick',
  'dblclick',
  'mousedown',
  'mouseup',
  'pointerup',
  'touchend',
  'keydown',
  'keyup',

And @Jimbly appears to be listening for

touchstart, touchend, click, mousedown and keydown

https://github.com/Jimbly/howler.js/blob/master/src/howler.core.js#L433-L438

In the short term at least, adding keydown (and maybe keyup?) would help with the accessibility issues.

Great project BTW 👍

@Jimbly
Copy link
Contributor

Jimbly commented Oct 27, 2020

I believe "keydown" and "mousedown" were the specific one I needed to add to fix actual observed problems as well, but having more seems like it cannot hurt, since they're cleaned up as soon as any one is fired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants