mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 20:15:31 +00:00
[Examples] Set a predefined cursor on Key.Space
Custom cursor are not enabled for OpenTK 1.1.2. They will be part of OpenTK 1.1.3.
This commit is contained in:
parent
a61d20d2eb
commit
51567e610c
|
@ -37,7 +37,8 @@ namespace Examples.Tutorial
|
||||||
offset, rgba, y * stride, stride);
|
offset, rgba, y * stride, stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Cursor = new OpenTK.MouseCursor(rgba, bitmap.Width, bitmap.Height, 0, 0);
|
//this.Cursor = new OpenTK.MouseCursor(rgba, bitmap.Width, bitmap.Height, 0, 0);
|
||||||
|
this.Cursor = MouseCursor.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Keyboard_KeyDown
|
#region Keyboard_KeyDown
|
||||||
|
@ -50,13 +51,29 @@ namespace Examples.Tutorial
|
||||||
void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
|
void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Escape)
|
if (e.Key == Key.Escape)
|
||||||
|
{
|
||||||
this.Exit();
|
this.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
if (e.Key == Key.F11)
|
if (e.Key == Key.Enter && e.Alt)
|
||||||
|
{
|
||||||
if (this.WindowState == WindowState.Fullscreen)
|
if (this.WindowState == WindowState.Fullscreen)
|
||||||
this.WindowState = WindowState.Normal;
|
this.WindowState = WindowState.Normal;
|
||||||
else
|
else
|
||||||
this.WindowState = WindowState.Fullscreen;
|
this.WindowState = WindowState.Fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Key == Key.Space)
|
||||||
|
{
|
||||||
|
if (Cursor == MouseCursor.Default)
|
||||||
|
{
|
||||||
|
Cursor = MouseCursor.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Cursor = MouseCursor.Default;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue