mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-09 21:15:39 +00:00
[X11] Renamed XI2Mouse
This file now implements both mouse and keyboard input, so its name has been updated to reflect that.
This commit is contained in:
parent
b4f4be7ece
commit
4ede3ad2d0
|
@ -697,7 +697,6 @@
|
||||||
<Compile Include="Platform\X11\X11Keyboard.cs" />
|
<Compile Include="Platform\X11\X11Keyboard.cs" />
|
||||||
<Compile Include="Platform\X11\X11Mouse.cs" />
|
<Compile Include="Platform\X11\X11Mouse.cs" />
|
||||||
<Compile Include="Input\ButtonState.cs" />
|
<Compile Include="Input\ButtonState.cs" />
|
||||||
<Compile Include="Platform\X11\XI2Mouse.cs" />
|
|
||||||
<EmbeddedResource Include="OpenTK.dll.config">
|
<EmbeddedResource Include="OpenTK.dll.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -802,6 +801,7 @@
|
||||||
<Compile Include="Input\MouseScroll.cs" />
|
<Compile Include="Input\MouseScroll.cs" />
|
||||||
<Compile Include="Platform\X11\X11Input.cs" />
|
<Compile Include="Platform\X11\X11Input.cs" />
|
||||||
<Compile Include="Platform\X11\XI2Input.cs" />
|
<Compile Include="Platform\X11\XI2Input.cs" />
|
||||||
|
<Compile Include="Platform\X11\XI2MouseKeyboard.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
if (input_driver == null)
|
if (input_driver == null)
|
||||||
{
|
{
|
||||||
if (XI2Mouse.IsSupported(IntPtr.Zero))
|
if (XI2MouseKeyboard.IsSupported(IntPtr.Zero))
|
||||||
{
|
{
|
||||||
input_driver = new XI2Input();
|
input_driver = new XI2Input();
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,11 +247,11 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
// The XInput2 extension makes keyboard and mouse handling much easier.
|
// The XInput2 extension makes keyboard and mouse handling much easier.
|
||||||
// Check whether it is available.
|
// Check whether it is available.
|
||||||
xi2_supported = XI2Mouse.IsSupported(window.Display);
|
xi2_supported = XI2MouseKeyboard.IsSupported(window.Display);
|
||||||
if (xi2_supported)
|
if (xi2_supported)
|
||||||
{
|
{
|
||||||
xi2_opcode = XI2Mouse.XIOpCode;
|
xi2_opcode = XI2MouseKeyboard.XIOpCode;
|
||||||
xi2_version = XI2Mouse.XIVersion;
|
xi2_version = XI2MouseKeyboard.XIVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
exists = true;
|
exists = true;
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
class XI2Input : IInputDriver2
|
class XI2Input : IInputDriver2
|
||||||
{
|
{
|
||||||
readonly XI2Mouse mouse_keyboard = new XI2Mouse();
|
readonly XI2MouseKeyboard mouse_keyboard = new XI2MouseKeyboard();
|
||||||
readonly X11Joystick joystick = new X11Joystick();
|
readonly X11Joystick joystick = new X11Joystick();
|
||||||
readonly IGamePadDriver gamepad = new MappedGamePadDriver();
|
readonly IGamePadDriver gamepad = new MappedGamePadDriver();
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ using OpenTK.Input;
|
||||||
|
|
||||||
namespace OpenTK.Platform.X11
|
namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
sealed class XI2Mouse : IKeyboardDriver2, IMouseDriver2, IDisposable
|
sealed class XI2MouseKeyboard : IKeyboardDriver2, IMouseDriver2, IDisposable
|
||||||
{
|
{
|
||||||
const XEventName ExitEvent = XEventName.LASTEvent + 1;
|
const XEventName ExitEvent = XEventName.LASTEvent + 1;
|
||||||
readonly object Sync = new object();
|
readonly object Sync = new object();
|
||||||
|
@ -89,7 +89,7 @@ namespace OpenTK.Platform.X11
|
||||||
static readonly Functions.EventPredicate PredicateImpl = IsEventValid;
|
static readonly Functions.EventPredicate PredicateImpl = IsEventValid;
|
||||||
readonly IntPtr Predicate = Marshal.GetFunctionPointerForDelegate(PredicateImpl);
|
readonly IntPtr Predicate = Marshal.GetFunctionPointerForDelegate(PredicateImpl);
|
||||||
|
|
||||||
static XI2Mouse()
|
static XI2MouseKeyboard()
|
||||||
{
|
{
|
||||||
using (new XLock(API.DefaultDisplay))
|
using (new XLock(API.DefaultDisplay))
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public XI2Mouse()
|
public XI2MouseKeyboard()
|
||||||
{
|
{
|
||||||
window = new X11WindowInfo();
|
window = new X11WindowInfo();
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~XI2Mouse()
|
~XI2MouseKeyboard()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
Dispose(false);
|
||||||
}
|
}
|
Loading…
Reference in a new issue