Event trigger by name now won't trigger disabled events.
4 using System.Collections.Generic;
5 using System.Diagnostics;
7 using System.Runtime.InteropServices;
8 using System.Runtime.Serialization;
10 using System.Threading.Tasks;
12 namespace SharpDisplayManager
15 /// Send a user key press event to the given CEC device.
18 [AttributeObject(Id = "Cec.UserControlPressed", Name = "CEC User Control Pressed", Description = "Send user control code to defined CEC device.")]
19 public class ActionCecUserControlPressed : ActionCecDevice
22 public ActionCecUserControlPressed()
28 [AttributeObjectProperty(
29 Id = "Cec.UserControlPressed.Code",
31 Description = "The key code used by this action."
33 public CecUserControlCode Code { get; set; }
36 [AttributeObjectProperty(
37 Id = "Cec.UserControlPressed.Wait",
39 Description = "Wait for that command."
41 public bool Wait { get; set; }
46 /// <returns></returns>
47 public override string BriefBase()
49 string brief = AttributeName + ": " + Code.ToString() + " to " + DeviceName;
60 protected override async Task DoExecute()
62 if (Cec.Client.Static == null)
64 Trace.WriteLine("WARNING: No CEC client installed.");
68 Cec.Client.Static.Lib.SendKeypress(Device, Code, Wait);