---
tags:
    - "Display"
    - "Label"
    - "Prompt"
    - "Layout"
    - "AZERTY"
    - "QWERTY"
---

# Keyboard Key Name

[Input](index.md) / **Keyboard Key Name**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

The name the specified key has on the current Keyboard layout

## Parameters

| Name | Description |
| :--- | :---------- |
| Key | The Keyboard key that is read |

## Code

```cs
using System;
using UnityEngine;
using UnityEngine.InputSystem;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Inline(nameof(m_Key))]

    [Title("Keyboard Key Name")]
    [Category("Input/Keyboard Key Name")]

    [Description("The name the specified key has on the current Keyboard layout")]
    [Image(typeof(IconKey), ColorTheme.Type.Blue)]

    [Parameter("Key", "The Keyboard key that is read")]

    [Keywords("Display", "Label", "Prompt", "Layout", "AZERTY", "QWERTY")]

    [Serializable]
    public class TypeStringInputKeyboardKeyName : TypeString
    {
        [SerializeField] private Key m_Key = Key.Space;

        public override string Get(Args args)
        {
            Keyboard keyboard = Keyboard.current;
            return keyboard != null ? keyboard[this.m_Key].displayName : string.Empty;
        }

        public override string ToString()
        {
            return $"Key {this.m_Key} Name";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

