using System.Diagnostics;
using UnityEngine;
public class KeyboardEvent : MonoBehaviour
{
private Process keyboard;
/// <summary>
/// 打开系统键盘
/// </summary>
public void ShowKeyboard()
{
keyboard=Process.Start("C:\\Windows\\System32\\osk.exe");
}
///关闭系统键盘
public void HideKeyboard()
{
if (keyboard != null&&!keyboard.HasExited)
{
keyboard.Kill();
keyboard = null;
}
}
}
脚本挂在InputField上,如下图
效果如下,运行当选中InputFeild时,调出系统键盘