Added method to opt in to the keypress-callback since this prevents reinitializing

This commit is contained in:
DarthAffe committed 2017-11-25 09:12:57 +01:00
1 parent 897162926a
commit 811a296867
2 files changed
+34 -3

No files matched your search

+13
View File
@@ -39,6 +39,8 @@ namespace SimpleDevTest
CueSDK.Initialize();
Console.WriteLine("Initialized with " + CueSDK.LoadedArchitecture + "-SDK");
CueSDK.EnableKeypressCallback();
CueSDK.KeyPressed += (sender, eventArgs) => Console.WriteLine($"Key {eventArgs.KeyId} {(eventArgs.IsPressed ? "pressed" : "released")}");
//CueSDK.KeyboardSDK.Brush = (SolidColorBrush)Color.Black;
@@ -76,6 +78,17 @@ namespace SimpleDevTest
CueSDK.UpdateMode = UpdateMode.Continuous;
Wait(5);
CueSDK.UpdateMode = UpdateMode.Manual;
for (int i = 0; i < 100000; i++)
{
CueSDK.Reinitialize();
Console.WriteLine(i);
}
Console.WriteLine("done!");
Wait(5);
//IBrush rainbowBrush = new LinearGradientBrush(new RainbowGradient());
//rainbowBrush.AddEffect(new FlashEffect { Attack = 5f, Sustain = 1f, Decay = 0, Release = 5f, Interval = 1f });
//rainbowBrush.AddEffect(new MoveRainbowEffect());