FakeDeck/FakeeDeck/ButtonType/MediaMacro.cs

36 lines
1.0 KiB
C#
Raw Normal View History

2024-09-09 19:11:36 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FakeeDeck.ButtonType
{
2024-09-09 20:56:27 +00:00
internal class MediaMacro : Button
2024-09-09 19:11:36 +00:00
{
public static Dictionary<string, uint[]> mediaControls = new Dictionary<string, uint[]>
{
{ "play/pause", new uint[] { 0xB3}},
{ "mute", new uint[] { 0xAD }},
};
public static Dictionary<string, string> mediaIcons = new Dictionary<string, string>
{
{ "play/pause", "fa-play"},
{ "mute", "fa-volume-xmark"},
};
public static string getButton(string Key)
{
2024-09-09 20:56:27 +00:00
return getButtonHTML(mediaIcons[Key], null, Key, "button\\MediaMacro", new Dictionary<string, string>() { { "control_action", Key } });
2024-09-09 19:11:36 +00:00
}
public static bool invokeAction(string control_action)
{
KeyboardMacro.SendKey(mediaControls[control_action][0]);
Console.WriteLine(control_action);
return true;
}
}
}