# Device Canvas Setup

{% hint style="warning" %}
This only needs to be done if you’re setting the canvas buttons yourself or if anything might be missing
{% endhint %}

### Basic Button Setup

1. Open the UI Manager GameObject

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2F7E7N0cioJ0i2hVriKASF%2FUIManagerObjects.JPG?alt=media&#x26;token=fe9032ab-ce3f-48c0-b7d4-8a8f81d70178" alt=""><figcaption></figcaption></figure>

2. Select and open out the appropriate **DeviceType - Canvas**

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2FOPNhV9ZbnuyAtkQ1Utyn%2FKeypadCanvasButtons.JPG?alt=media&#x26;token=408fc2e2-9dd8-4c2c-9769-17e2ec62f586" alt=""><figcaption></figcaption></figure>

3. Select any of the Button numbers, add an **OnClick()** event in the bottom right of the inspector by clicking the **+** (Unless it already has one added)
4. Add your **CodeDeviceUIManager** (UI Manager GameObject) to the available slot

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2Fae4eNCmcZmnoMxTerzsm%2FOnClick_Key.JPG?alt=media&#x26;token=34bbfa0c-bd60-4f1c-8499-53b5b8e0695f" alt=""><figcaption></figcaption></figure>

5. On the drop down on the right (No function dropdown if nothing is selected)&#x20;
   1. Choose the **CodeDeviceUIManager** option which will open out into more
6. Choose **CodeDeviceUIManager.KeyPressString**
7. You can then add whatever number or keyboard symbol you like in the slot below the dropdown
8. Continue this for each button available.

{% hint style="warning" %}
**Similar setup for the CLOSE / CLEAR / Submit Buttons**
{% endhint %}

### **Clear / Close / Submit Buttons Setup**

1. Select any of the input keys, add an **OnClick()** event in the bottom right of the inspector by clicking the **+**
2. Add your **CodeDeviceUIManager** GameObject to the available slot
3. On the drop down on the right, choose the **CodeDeviceUIManager** option which will open out into more

### Close Key

{% hint style="info" %}
Choose: **CodeDeviceUIManager.KeyPressClose**
{% endhint %}

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2FqRB60zBEuOrn1zo4MVo9%2FKeyCloseCanvas.JPG?alt=media&#x26;token=7db6c0ec-4c5b-4a7d-91a0-371b5fea337d" alt=""><figcaption></figcaption></figure>

### **Clear Key**

{% hint style="info" %}
Choose: **CodeDeviceUIManager.KeyPressClear**
{% endhint %}

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2FEpZc9Y7BxJEXxzXOjyv0%2FClear.JPG?alt=media&#x26;token=24ca312a-83d8-4455-8474-4b52accdd8aa" alt=""><figcaption></figcaption></figure>

### **Submit Key**

{% hint style="info" %}
Choose: **CodeDeviceUIManager.KeyPressSubmit**
{% endhint %}

<figure><img src="https://3807630089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7GiPc_l1RUpLjZfGG%2Fuploads%2F9gOIkoBIOlMOvrBN2Gvl%2FSubmit.JPG?alt=media&#x26;token=a589ac96-4c49-4b59-b988-74a901977539" alt=""><figcaption></figcaption></figure>
