mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-08 12:50:42 +00:00
Disabled support for multiple devices to minimize memory and CPU usage.
This commit is contained in:
parent
605225822a
commit
8eb779558c
|
@ -284,11 +284,15 @@ namespace OpenTK.Platform.Windows
|
||||||
// came not from a physical keyboard device but from a code-generated input message - in
|
// came not from a physical keyboard device but from a code-generated input message - in
|
||||||
// that case, the event goes to the default (first) keyboard.
|
// that case, the event goes to the default (first) keyboard.
|
||||||
// TODO: Send the event to all keyboards instead of the default one.
|
// TODO: Send the event to all keyboards instead of the default one.
|
||||||
int index = keyboards.FindIndex(delegate(KeyboardDevice kb)
|
// TODO: Optimize this! The predicate allocates way to much memory.
|
||||||
{
|
//int index = keyboards.FindIndex(delegate(KeyboardDevice kb)
|
||||||
return kb.DeviceID == rin.Header.Device;
|
//{
|
||||||
});
|
// return kb.DeviceID == rin.Header.Device;
|
||||||
if (index == -1) index = 0;
|
//});
|
||||||
|
//if (index == -1) index = 0;
|
||||||
|
int index;
|
||||||
|
if (keyboards.Count > 0) index = 0;
|
||||||
|
else return false;
|
||||||
|
|
||||||
// Generic control, shift, alt keys may be sent instead of left/right.
|
// Generic control, shift, alt keys may be sent instead of left/right.
|
||||||
// It seems you have to explicitly register left/right events.
|
// It seems you have to explicitly register left/right events.
|
||||||
|
|
|
@ -167,11 +167,13 @@ namespace OpenTK.Platform.Windows
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal bool ProcessEvent(RawInput rin)
|
internal bool ProcessEvent(RawInput rin)
|
||||||
{
|
{
|
||||||
MouseDevice mouse = mice.Find(delegate(MouseDevice m)
|
//MouseDevice mouse = mice.Find(delegate(MouseDevice m)
|
||||||
{
|
//{
|
||||||
return m.DeviceID == rin.Header.Device;
|
// return m.DeviceID == rin.Header.Device;
|
||||||
});
|
//});
|
||||||
if (mouse == null && mice.Count > 0) mouse = mice[0];
|
MouseDevice mouse;
|
||||||
|
if (mice.Count > 0) mouse = mice[0];
|
||||||
|
else return false;
|
||||||
|
|
||||||
switch (rin.Header.Type)
|
switch (rin.Header.Type)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue