mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-10 20:46:24 +00:00
Added method to opt in to the keypress-callback since this prevents reinitializing
This commit is contained in:
1 parent
897162926a
commit
811a296867
2 files changed
+34
-3
No files matched your search
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user