This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,29 @@
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;
}
}
}