Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 6, 2018 07:53
Show Gist options
  • Select an option

  • Save unitycoder/f29aaa084406db67f8fe26bcd8ecc466 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/f29aaa084406db67f8fe26bcd8ecc466 to your computer and use it in GitHub Desktop.
Unity capslock detection
// https://www.reddit.com/r/Unity3D/comments/94z2aa/easy_capslock_detection/
[System.Runtime.InteropServices.DllImport("USER32.dll")] public static extern short GetKeyState(int nVirtKey);
bool IsCapsLockOn => (GetKeyState(0x14) & 1) > 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment