title: Send media keys over bluetooth to an iOS device
body: <p>Using a Raspberry Pi 2 and a Bluetooth dongle, I am trying to mimic the behaviour of an Apple Bluetooth Keyboard.</p>
  <p>I am pairing the Raspberry Pi (as an HID) to an iPad over bluetooth. Using a <a href="https://github.com/yaptb/BlogCode" rel="nofollow noreferrer">python script</a> I send keycodes to the iPad, all of the classic keys such as letters and numbers seem to be working but media commands like Volume Up and Volume Down do nothing.</p>
  <p>In order to find the appropriate keycodes for the Volume commands I connected a (real) Apple Magic Keyboard to my Raspberry Pi and used the <a href="https://unix.stackexchange.com/questions/328039/unable-to-find-keycode-for-volume-key-on-apple-keyboard">evtest command</a> in order to reveal the keycodes when I was pressing on any key. The output:</p>
  <pre><code>key event at 1634155651.384849, 115 (KEY_VOLUMEUP), down
  key event at 1634155651.458680, 115 (KEY_VOLUMEUP), up
  key event at 1634155652.178809, 114 (KEY_VOLUMEDOWN), down
  key event at 1634155652.238946, 114 (KEY_VOLUMEDOWN), up
  </code></pre>
  <p>Respectively sending the keycodes 115 and 114 do not do anything on the iOS device. What could I be missing?</p>
  <p>Thanks.</p>
  <p><strong>UPDATE</strong></p>
  <p>I used a macOS app named <a href="https://manytricks.com/keycodes/" rel="nofollow noreferrer">Key Codes</a> to detect keycodes from the same Magic Keyboard. It turns out that the media volume keys do not yield any output at all. Could this be why iOS do not detect those keys? Maybe they are not considered as real &quot;keys&quot;. I do not find anything relevant on Internet about it unfortunately.</p>