OS X Media Key Event Capture in Firefox

Does Firefox provide an API for extensions to capture media key events in OS X? They are physically located on the F7 / F8 / F9 keys on Apple keyboards, but they do not have key codes, so it is not possible to intercept the media key event with the event onkeypress.

To clarify: I tried using several JS tools that detect key codes in events onkeypress. I can say with 100% certainty that OS X multimedia keys do not send an event onkeypressin any popular JS browser implementation, unless the key fnis held simultaneously, but that is not what I ask.

As far as I understand, Chrome implements a separate API that allows you to capture media keystroke events. I ask if Firefox provides a similar API.

+4
source share
2 answers

Function keys have key codes. Think you are talking about something like Fn + F7/F8/F9? To do this, you can intercept a combination with several keys. But it can get pretty dirty.

See this and this for gory details.

+1
source

This addon here says it supports osx media keys: https://github.com/mikedeboer/soundcloud-player

Quote:

: https://github.com/mstange/mediakeysappleremotesimfy/issues/1

c, . , :

  • , js-ctypes, mainthread , .
  • , - api -.
0

Source: https://habr.com/ru/post/1608342/


All Articles