Platforms to show: All Mac Windows Linux Cross-Platform

MediaKeysMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Media Keys MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Catch some special keys with this class.
Example
dim m as MediaKeysMBS // global property!

// app initialization
m = new MediaKeysMBS

// set which keys to watch for
m.Keys(MediaKeysMBS.kMediaKeyEject) = MediaKeysMBS.kModeEventAndBlock

// and start
m.startWatchingMediaKeys

First written to catch play, fast and rewind keys from Apple keyboards.
Later extended to also catch other keys.
Still not all keys are available on all keyboards.

Please have only instance of this class running your application.

Key Constants

Constant Value Description
kMediaKeyBrightnessDown 3 Example
kMediaKeyBrightnessUp 2 Example
kMediaKeyCapsLock 4 Caps Lock
Example
kMediaKeyContrastDown 12 Example
kMediaKeyContrastUp 11 Example
kMediaKeyDownArrow 9 Example
kMediaKeyEject 14 Eject key
Example
kMediaKeyFast 19 Fast key. On by default.
Example
kMediaKeyHelp 5 Example
kMediaKeyIlluminationDown 22 Example
kMediaKeyIlluminationToggle 23 Example
kMediaKeyIlluminationUp 21 Example
kMediaKeyLaunchPanel 13 Example
kMediaKeyMute 7 Sound Mute
Example
kMediaKeyNext 17 Example
kMediaKeyNumLock 10 Num Lock key
Example
kMediaKeyPlay 16 Play key. On by default.
Example
kMediaKeyPower 6 Power Key
Example
kMediaKeyPrevious 18 Previous key
Example
kMediaKeyRewind 20 Rewind Key. On by default.
Example
kMediaKeySoundDown 1 Sound down
Example
kMediaKeySoundUp 0 Sound up
Example
kMediaKeyUpArrow 8 Example
kMediaKeyVideoMirror 15 Example

Mode Constants

Constant Value Description
kModeBlock 1 Block the event.
kModeEventAndBlock 2 Call the receivedMediaKeyEvent event and block the event.
kModeEventAndPass 3 Call the receivedMediaKeyEvent event and pass the event to other applications.
kModePass 0 Pass event to other applications.

This class has no sub classes.

Some examples using this class:

Blog Entries


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


MDQueryMBS   -   MemoryBlock


The biggest plugin in space...