WingMan
/trunk/WingMan/Bindings/KeySimulator.cs |
@@ -4,7 +4,6 @@ |
using System.Threading.Tasks; |
using WindowsInput; |
using WindowsInput.Native; |
using MQTTnet; |
using WingMan.Communication; |
using WingMan.Utilities; |
|
@@ -41,13 +40,17 @@ |
|
public event MouseKeyBindingExecuting OnMouseKeyBindingExecuting; |
|
private async void OnMqttMessageReceived(object sender, MqttApplicationMessageReceivedEventArgs e) |
private async void OnMqttMessageReceived(object sender, MqttCommunicationMessageReceivedEventArgs e) |
{ |
if (e.ApplicationMessage.Topic != "execute") |
if (e.Topic != "execute") |
return; |
|
using (var memoryStream = new MemoryStream(e.ApplicationMessage.Payload)) |
using (var memoryStream = new MemoryStream()) |
{ |
await e.PayloadStream.CopyToAsync(memoryStream); |
|
memoryStream.Position = 0L; |
|
var executeMouseKeyBinding = |
(ExecuteKeyBinding) ExecuteKeyBinding.XmlSerializer.Deserialize(memoryStream); |
|
@@ -100,4 +103,4 @@ |
} |
} |
} |
} |
} |