WingMan
/trunk/WingMan/Bindings/KeyInterceptor.cs |
@@ -7,6 +7,7 @@ |
using System.Threading.Tasks.Dataflow; |
using System.Windows.Forms; |
using Gma.System.MouseKeyHook; |
using ProtoBuf; |
using WingMan.Communication; |
using WingMan.Utilities; |
|
@@ -16,7 +17,7 @@ |
{ |
public delegate void MouseKeyBindingMatched(object sender, KeyBindingMatchedEventArgs args); |
|
private volatile bool ProcessPipe; |
private volatile bool _processPipe; |
|
public KeyInterceptor(RemoteKeyBindings remoteKeyBindings, MqttCommunication mqttCommunication, |
TaskScheduler taskScheduler, CancellationToken cancellationToken) |
@@ -98,7 +99,7 @@ |
|
try |
{ |
if (!ProcessPipe) |
if (!_processPipe) |
return; |
|
foreach (var binding in RemoteKeyBindings.Bindings) |
@@ -116,7 +117,7 @@ |
|
using (var memoryStream = new MemoryStream()) |
{ |
ExecuteKeyBinding.XmlSerializer.Serialize(memoryStream, |
Serializer.Serialize(memoryStream, |
new ExecuteKeyBinding(binding.Nick, binding.Name)); |
|
memoryStream.Position = 0L; |
@@ -135,7 +136,7 @@ |
|
private async void MouseKeyGloalHookOnKeyDown(object sender, KeyEventArgs e) |
{ |
ProcessPipe = true; |
_processPipe = true; |
|
if (!KeyConversion.KeysToString.TryGetValue((byte) e.KeyCode, out var key)) |
return; |
@@ -154,7 +155,7 @@ |
|
private void MouseKeyGloalHookOnKeyUp(object sender, KeyEventArgs e) |
{ |
ProcessPipe = false; |
_processPipe = false; |
} |
} |
} |
} |