private Bitmap GetKey(MediaKeys key) { switch (key) { case MediaKeys.Back: return(Resources.img_item_media_back); case MediaKeys.Next: return(Resources.img_item_media_next); case MediaKeys.PlayPause: return(Resources.img_item_media_playpause); case MediaKeys.Stop: return(Resources.img_item_media_stop); case MediaKeys.VolumeOff: return(Resources.img_item_media_volumeoff); case MediaKeys.VolumeMinus: return(Resources.img_item_media_volumedown); case MediaKeys.VolumePlus: return(Resources.img_item_media_volumeup); default: return(null); } }
public Keys GetKeyFromMediaKey(MediaKeys mediaKey) { switch (mediaKey) { case MediaKeys.Back: return(Keys.MediaPreviousTrack); case MediaKeys.Next: return(Keys.MediaPreviousTrack); case MediaKeys.PlayPause: return(Keys.MediaPlayPause); case MediaKeys.Stop: return(Keys.MediaStop); case MediaKeys.VolumeOff: return(Keys.VolumeMute); case MediaKeys.VolumeMinus: return(Keys.VolumeDown); case MediaKeys.VolumePlus: return(Keys.VolumeUp); } return(Keys.None); }
public void SendMediaKey(MediaKeys mediaKey) { SendReportKey(0x03, (byte)mediaKey, 0, 0); }
/// <summary> /// Initialzes a new instance of the <see cref="MediaKeyEventArgs"/> class. /// </summary> public MediaKeyEventArgs(MediaKeys key) { Key = key; }