Glfw.GetKeyName(Keys key, int scanCode) throws an internal NullReferenceException when specifying a key that is non-printable (eg. Keys.LeftControl). Description states the method returnes null instead. To fix this, changing
public static string GetKeyName(Keys key, int scanCode)
{
return Util.PtrToStringUTF8(GetKeyNameInternal(key, scanCode));
}
to
public static string GetKeyName(Keys key, int scanCode)
{
IntPtr ptr = GetKeyNameInternal(key, scanCode);
return ptr == IntPtr.Zero? null : Util.PtrToStringUTF8(ptr);
}
should probably do the trick.
Side note: what are the plans on releasing the current/corrected version to nuget?