PDA

View Full Version : teensy 3 missing implementation for set_media



gregersrygg
09-18-2013, 10:40 PM
Hi,

I noticed the set_media function wasn't implemented for teensy 3. It's only missing a few lines of code to work, so why not add it? Found some old threads about Windows security issues, but it would't hurt anyone to add 4 lines so it works on other platforms :)

With this patch it works to send media keys on Android 4.x. (Haven't tested any other OSes)
https://github.com/gregersrygg/teensyduino-android-keyboard/commit/d082419418097bcd98dae6f672bbe0e8c8385bab.patch

Documentation wise, it would be nice to mention that set_media doesn't allow HID Usage IDs, but only works with these pre-defined keys: KEY_MEDIA_VOLUME_INC, KEY_MEDIA_VOLUME_DEC, KEY_MEDIA_MUTE, KEY_MEDIA_PLAY_PAUSE, KEY_MEDIA_NEXT_TRACK, KEY_MEDIA_PREV_TRACK, KEY_MEDIA_STOP, KEY_MEDIA_EJEC.

Thanks,
Gregers

PaulStoffregen
09-19-2013, 02:02 PM
I've merged this patch for the 1.17 release. I just tested on a Teensy3 and it's working very nicely with Rhythmbox on the Linux desktop.

I'm sorry this took so long. I saw this during 1.15. The Mini54 low power optimization (now released as 1.16) turned out to be LOT more challenging than I had originally anticipated. Once that was working well, I released 1.16 without this and a huge pile of other planned improvements. I'm catching up to so many little fixes and improvements for 1.17.... before I get pulled into the audio library for a couple months.

Wraithan
09-19-2013, 06:34 PM
Hey, glad my patch has been helpful!

Hondo88
11-08-2013, 09:01 PM
Hello, I've done a few small arduino projects, but nothing with Teensy, and had a couple of questions. I'm looking to use a Teensy 3 to do media control on an Andriod (tablet for now) device. Based on above it sounds like this may be possible. Is the media key command syntax the same as the standard keys? I didn't see the (media key) listed in the key list. Is the Teensyduino 1.17 available yet?

PaulStoffregen
11-08-2013, 09:29 PM
1.17-rc1 is available here (http://forum.pjrc.com/threads/24393-Teensyduino-1-17-Release-Candidate-1-Available).

See the example in File > Examples > Teensy > USB_Keyboard > MediaButtons

Hondo88
11-30-2013, 09:35 PM
Just wanted to say thanks for this.
Ordered a Teensy 3 and finally got around to trying it.
Worked (controlled media (Google Music)) first time on an (first gen) Nexus 7 with an OTG cable.

Its mentioned in some of the document (like here (http://www.pjrc.com/teensy/td_keyboard.html)) but I wanted to note it doesn't work on Windows, but does on Android and Linux (didn't try Mac) in case others stumble upon this thread.

soundShinobi
05-23-2014, 04:24 PM
Just wanted to say thanks for this.
Ordered a Teensy 3 and finally got around to trying it.
Worked (controlled media (Google Music)) first time on an (first gen) Nexus 7 with an OTG cable.

Its mentioned in some of the document (like here (http://www.pjrc.com/teensy/td_keyboard.html)) but I wanted to note it doesn't work on Windows, but does on Android and Linux (didn't try Mac) in case others stumble upon this thread.

Has there been any update on the Windows portion of this? I'm very new to Teensy and I'm wanting to use the media key functions with my Teensy 2 for a project. I would of course like for it to work across all major OS including Windows 8.1

GallantJR
08-06-2014, 06:30 AM
Has there been any update on the Windows portion of this? I'm very new to Teensy and I'm wanting to use the media key functions with my Teensy 2 for a project. I would of course like for it to work across all major OS including Windows 8.1

I would love to know if it has been fix too ! Anyone ?

Did try on Teensy 3.1 with teensyduino 1.19 and arduino 1.0.5 and it still not working !

Paul
04-12-2016, 12:08 AM
If anyone's still watching this old thread, new & improved media key support is available.

https://forum.pjrc.com/threads/34074-Keyboard-Media-Keys-now-%28hopefully%29-Windows-compatible

I'm closing this old thread. Please comment on the new thread.