Files
BookRPG/Library/PackageCache/com.unity.collab-proxy@0b1559bcd34e/Editor/CodeEditor/Keyboard.cs

29 lines
708 B
C#
Raw Normal View History

2026-07-16 21:49:59 +01:00
using System.Runtime.InteropServices;
using UnityEngine;
namespace Unity.CodeEditor
{
internal static class Keyboard
{
internal static bool IsKeyPressed(Event e, KeyCode keyCode)
{
if (e == null)
return false;
return e.type == EventType.KeyDown
&& e.keyCode == keyCode;
}
internal static bool IsControlOrCommandKeyPressed(Event e)
{
if (e == null)
return false;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
return e.type == EventType.KeyDown && e.command;
return e.type == EventType.KeyDown && e.control;
}
}
}