We want to provide better input integration in NoesisGUI in a following release, by addding the possibility to inject input events directly into the NoesisGUIPanel component.
While this is publicly released, you can patch our scripts like this:
Assets/Plugins/NoesisGUI/Scripts/NoesisGUIPanel.cs
using UnityEngine;
using Noesis;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
[AddComponentMenu("NoesisGUI/NoesisGUI Panel")]
public class NoesisGUIPanel : MonoBehaviour
{
// ...
////////////////////////////////////////////////////////////////////////////////////////////////
private Noesis.UIRenderer _uiRenderer;
////////////////////////////////////////////////////////////////////////////////////////////////
public T GetRoot<T>() where T : BaseComponent
{
if (_uiRenderer != null)
{
return _uiRenderer.GetRoot<T>();
}
else
{
return null;
}
}
// ADD THE FOLLOWING FUNCTIONS FOR INPUT HANDLING
//@{
////////////////////////////////////////////////////////////////////////////////////////////////
public void KeyDown(Noesis.Key key)
{
if (_uiRenderer != null)
{
_uiRenderer.KeyDown(key);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
public void KeyUp(Noesis.Key key)
{
if (_uiRenderer != null)
{
_uiRenderer.KeyUp(key);
}
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseDown(float x, float y, Noesis.MouseButton button)
{
if (_uiRenderer != null)
{
_uiRenderer.MouseDown(x, y, button);
}
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseUp(float x, float y, Noesis.MouseButton button)
{
if (_uiRenderer != null)
{
_uiRenderer.MouseUp(x, y, button);
}
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseDoubleClick(float x, float y, Noesis.MouseButton button)
{
if (_uiRenderer != null)
{
_uiRenderer.MouseDoubleClick(x, y, button);
}
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseWheel(float x, float y, int wheelRotation)
{
if (_uiRenderer != null)
{
_uiRenderer.MouseWheel(x, y, wheelRotation);
}
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseMove(float x, float y)
{
if (_uiRenderer != null)
{
_uiRenderer.MouseMove(x, y);
}
}
//@}
// ...
}
Assets/Plugins/NoesisGUI/Scripts/Core/NoesisUIRenderer.cs
using UnityEngine;
using System;
using System.Runtime.InteropServices;
namespace Noesis
{
// ...
/////////////////////////////////////////////////////////////////////////////////////
/// Manages updates, render and input events of a Noesis UI panel
/////////////////////////////////////////////////////////////////////////////////////
internal partial class UIRenderer
{
// ...
/////////////////////////////////////////////////////////////////////////////////
public T GetRoot<T>() where T : BaseComponent
{
return _root.As<T>();
}
// ADD THE FOLLOWING FUNCTIONS FOR INPUT HANDLING
//@{
/////////////////////////////////////////////////////////////////////////////////
public void KeyDown(Noesis.Key key)
{
Noesis_KeyDown(_rendererId, (int)key);
}
/////////////////////////////////////////////////////////////////////////////////
public void KeyUp(Noesis.Key key)
{
Noesis_KeyUp(_rendererId, (int)key);
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseDown(float x, float y, Noesis.MouseButton button)
{
Noesis_MouseButtonDown(_rendererId, x, y, (int)button);
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseUp(float x, float y, Noesis.MouseButton button)
{
Noesis_MouseButtonUp(_rendererId, x, y, (int)button);
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseDoubleClick(float x, float y, Noesis.MouseButton button)
{
Noesis_MouseDoubleClick(_rendererId, x, y, (int)button);
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseWheel(float x, float y, int wheelRotation)
{
Noesis_MouseWheel(_rendererId, x, y, wheelRotation);
}
/////////////////////////////////////////////////////////////////////////////////
public void MouseMove(float x, float y)
{
Noesis_MouseMove(_rendererId, x, y);
}
//@}
// ...
}
}
You can simulate a mouse pointer with the axis info of your gamepad. Or maybe you will prefer to simulate Tab, Shift+Tab, and Arrow keys to manage Keyboard focus.