> For the complete documentation index, see [llms.txt](https://espergames.gitbook.io/skill-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://espergames.gitbook.io/skill-web/scripting/keyboard-and-controller-support.md). Agents can also search and read this documentation through its [MCP server](https://espergames.gitbook.io/skill-web/~gitbook/mcp).

# Keyboard & Controller Support

For keyboard and controller support, you need to add the [Web View Selector UGUI](https://espergames.gitbook.io/skill-web/components/ugui/web-view-ugui/web-view-selector-ugui.md) into your scene and call the appropriate methods in your [Web View UGUI](https://espergames.gitbook.io/skill-web/components/ugui/web-view-ugui.md) when specific input buttons are pressed.

## Example Script

This script is used for the demo scenes.

```csharp
using Esper.SkillWeb.UI.UGUI;
using UnityEngine;
using UnityEngine.InputSystem;

namespace Esper.SkillWeb.Examples
{
    public class SkillWebInputExample : MonoBehaviour
    {
        [SerializeField, Min(0)]
        private float moveSpeed = 5;

        [SerializeField, Min(0)]
        private float zoomSpeed = 10;

        private void OnMove(InputValue value)
        {
            var move = value.Get<Vector2>();
            move *= moveSpeed;
            WebViewUGUI.Active.Move(move);
        }

        private void OnFocus(InputValue value)
        {
            var move = value.Get<Vector2>();

            if (move != Vector2.zero)
            {
                WebViewUGUI.Active.Focus(move);
            }
        }

        private void OnResetView(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.ResetView();
            }
        }

        private void OnResetSkills(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.ResetAllSkills();
            }
        }

        private void OnZoomIn(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.SetConstantZoom(zoomSpeed);
            }
            else
            {
                WebViewUGUI.Active.SetConstantZoom(0);
            }
        }

        private void OnZoomOut(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.SetConstantZoom(-zoomSpeed);
            }
            else
            {
                WebViewUGUI.Active.SetConstantZoom(0);
            }
        }

        private void OnRemoveFocus(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.RemoveFocus();
            }
        }

        private void OnUpgrade(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.UpgradeFocused();
            }
        }

        private void OnDowngrade(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.DowngradeFocused();
            }
        }

        private void OnToggle(InputValue value)
        {
            if (value.isPressed)
            {
                WebViewUGUI.Active.Toggle();
            }
        }
    }
}
```
