I am working on an in game console for Android, working with bluetooth keyboards. I want to send console inputs by pressing the return key on the bluetooth keyboard. However I am running into trouble detecting the keypress.
I am using the following code to debug keypresses from the bluetooth keyboard:
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class PrintKeyInputs : MonoBehaviour
{
public Text TextField;
void Update()
{
foreach(KeyCode kcode in Enum.GetValues(typeof(KeyCode)))
{
if (Input.GetKeyDown(kcode))
TextField.text = "KeyCode down: " + kcode;
Debug.Log("KeyCode down: " + kcode);
}
}
}
Pressing the return key doesn’t return anything on kcode
.
Any ideas how to get the return keypress?