โŒšSB Watch 2
๐Ÿšš Free fedex shipping from 97 $
๐ŸŒŽ WORLDWIDE SHIPPING for 25 $
Search
Close this search box.

Keyboard Media

About

With theย Media Keyboard you gain control over volume and music playback on your phone, compatible with various platforms including Spotify, Apple Music, and YouTube. Furthermore, certain apps can detect volume up/down key presses, ensuring compatibility. For example, SB Mote and selfie remotes send volume-up signals, so apps supporting them should be compatible with this keyboard, too.

The code:

				
					const mapping = [
  null,    '#VOL_UP',     null,
  '#PREV', '#PLAY_PAUSE', '#NEXT',
  null,    '#VOL_DOWN',   null,
  null,    '#MUTE',       null,
];

function onAtomButtonClick(keyCode, count) {
  const key = mapping[keyCode];
  if (!key) return;
  
  keyboard.send(key);
}

function onEvent(e) {
  if (e.source !== 'atom:button') return;

  const buttonId = parseInt(e.value);
  if (e.type === 'click' || e.type === 'longpress' || e.type === 'repeatpress') {
      return onAtomButtonClick(buttonId);
  }
  if (strSub(e.type, 0, 5) === 'click' && strLen(e.type) === 6) {
      const clickCount = parseInt(strCharAt(e.type, 5));
      for (let i = 0; i < clickCount; i++) {
          onAtomButtonClick(buttonId);
      }
  }
}
				
			

General

๐Ÿ“ƒย First Steps

MagiScript Editor

๐Ÿ“ƒย Basics

๐Ÿ“ƒย Running Your First Program

๐Ÿ“ƒย App Store

๐Ÿ“ƒย Atom Settings (Editor)

๐Ÿ“ƒย Debugging Techniques

Examples

๐Ÿ“ƒย Atom Time

๐ŸŽž๏ธ Time Practice

๐Ÿ“ƒย Atom Pi (Pi Revelations)

๐Ÿ“ƒย Atom Drum

๐ŸŽž๏ธ Atom Stack

๐Ÿ“ƒย Atom Square

๐Ÿ“ƒย Atom Level

๐Ÿ“ƒย Atom THMPR

๐Ÿ“ƒย Poker Hands

๐Ÿ“ƒย Keyboard Numeric

๐Ÿ“ƒย Keyboard NOKIA

๐Ÿ“ƒย Keyboard Cursor

๐Ÿ“ƒย Keyboard Media

๐Ÿ“ƒย Keyboard Custom

Input/Output

๐Ÿ“ƒย Buttons

๐Ÿ“ƒย Vibration Motor

๐Ÿ“ƒย RGB LED

๐Ÿ“ƒย Devices

๐Ÿ“ƒย PeekSmith

๐Ÿ“ƒย SB Watch

๐Ÿ“ƒย Bluetooth Keyboard

๐Ÿ“ƒย Bluetooth Mouse

๐Ÿ“ƒย Timers

๐Ÿ“ƒย Database

๐Ÿ“ƒย Events

๐Ÿ“ƒย System (exit, sleep, rand)

๐Ÿ“ƒย Objects (card, time)

Language

๐Ÿ“ƒย Summary

๐Ÿ“ƒย Comments

๐Ÿ“ƒย Variable Declarations

๐Ÿ“ƒย Operators

๐Ÿ“ƒย Control Flow

๐Ÿ“ƒย Functions

๐Ÿ“ƒย Numbers

๐Ÿ“ƒย Strings

๐Ÿ“ƒย Arrays

๐Ÿ“ƒย Objects

๐Ÿ“ƒย Uint8Array