mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-23 05:01:12 +00:00
Disabled support for multiple devices to minimize memory and CPU usage.
This commit is contained in:
parent
f71bb87fe1
commit
8cce2ac278
|
@ -284,11 +284,15 @@ namespace OpenTK.Platform.Windows
|
|||
// 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.
|
||||
// TODO: Send the event to all keyboards instead of the default one.
|
||||
int index = keyboards.FindIndex(delegate(KeyboardDevice kb)
|
||||
{
|
||||
return kb.DeviceID == rin.Header.Device;
|
||||
});
|
||||
if (index == -1) index = 0;
|
||||
// TODO: Optimize this! The predicate allocates way to much memory.
|
||||
//int index = keyboards.FindIndex(delegate(KeyboardDevice kb)
|
||||
//{
|
||||
// return kb.DeviceID == rin.Header.Device;
|
||||
//});
|
||||
//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.
|
||||
// It seems you have to explicitly register left/right events.
|
||||
|
|
|
@ -167,11 +167,13 @@ namespace OpenTK.Platform.Windows
|
|||
/// <returns></returns>
|
||||
internal bool ProcessEvent(RawInput rin)
|
||||
{
|
||||
MouseDevice mouse = mice.Find(delegate(MouseDevice m)
|
||||
{
|
||||
return m.DeviceID == rin.Header.Device;
|
||||
});
|
||||
if (mouse == null && mice.Count > 0) mouse = mice[0];
|
||||
//MouseDevice mouse = mice.Find(delegate(MouseDevice m)
|
||||
//{
|
||||
// return m.DeviceID == rin.Header.Device;
|
||||
//});
|
||||
MouseDevice mouse;
|
||||
if (mice.Count > 0) mouse = mice[0];
|
||||
else return false;
|
||||
|
||||
switch (rin.Header.Type)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue