コード例 #1
0
        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);
        }
コード例 #2
0
 public static string GetDefaultText(this HardwareKey key) =>
 SpecialDefaultTexts.ContainsKey(key) ? SpecialDefaultTexts[key] : key.ToString();