public bool Equals(CharacterMappingTarget other) { var equals = false; // Try to convert char to key switch (Modifiers) { case Modifier.Shift: equals = other.Character.ToString() == HardwareKey.ToString().ToUpper(); break; case Modifier.None: equals = other.Character.ToString() == HardwareKey.ToString().ToLower(); break; } // Special case: Space if (!equals) { equals |= (other.Character == ' ' && HardwareKey == HardwareKey.Space); } return(equals); }
public static string GetDefaultText(this HardwareKey key) => SpecialDefaultTexts.ContainsKey(key) ? SpecialDefaultTexts[key] : key.ToString();