当前位置: 首页>>代码示例>>C#>>正文


C# KeyType类代码示例

本文整理汇总了C#中KeyType的典型用法代码示例。如果您正苦于以下问题:C# KeyType类的具体用法?C# KeyType怎么用?C# KeyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


KeyType类属于命名空间,在下文中一共展示了KeyType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryGetKeyInput

        /// <summary>
        /// Try and get the KeyInput which corresponds to the given Key and modifiers
        /// TODO: really think about this method
        /// </summary>
        internal bool TryGetKeyInput(Key key, ModifierKeys modifierKeys, out KeyInput keyInput)
        {
            // First just check and see if there is a direct mapping
            var keyType = new KeyType(key, modifierKeys);
            if (_cache.TryGetValue(keyType, out keyInput))
            {
                return true;
            }

            // Next consider only the shift key part of the requested modifier.  We can
            // re-apply the original modifiers later
            keyType = new KeyType(key, modifierKeys & ModifierKeys.Shift);
            if (_cache.TryGetValue(keyType, out keyInput))
            {
                // Reapply the modifiers
                keyInput = KeyInputUtil.ChangeKeyModifiers(keyInput, ConvertToKeyModifiers(modifierKeys));
                return true;
            }

            // Last consider it without any modifiers and reapply
            keyType = new KeyType(key, ModifierKeys.None);
            if (_cache.TryGetValue(keyType, out keyInput))
            {
                // Reapply the modifiers
                keyInput = KeyInputUtil.ChangeKeyModifiers(keyInput, ConvertToKeyModifiers(modifierKeys));
                return true;
            }

            return false;
        }
开发者ID:praveennet,项目名称:VsVim,代码行数:34,代码来源:KeyboardMap.cs

示例2: KeySequence

    public KeySequence(string name, KeyType[] keys, Element prim, Element sec) {
    	this.name = name;
        _keys = keys;
        Primary = prim;
        Secondary = sec;

    }
开发者ID:shingokko,项目名称:combocannon,代码行数:7,代码来源:KeySequence.cs

示例3: EntityKey

 public EntityKey(string value, KeyType type)
 {
     if (value == null) throw new ArgumentNullException("key");
     _value = value;
     _hashedValue = EntityBuilder.Fnv1Hash(_value);
     _type = type;
 }
开发者ID:nagyist,项目名称:wpfrealtime,代码行数:7,代码来源:EntityKey.cs

示例4: RainbowFolder

 public RainbowFolder(KeyType type, string key, Texture2D smallIcon, Texture2D largeIcon)
 {
     Type = type;
     Key = key;
     SmallIcon = smallIcon;
     LargeIcon = largeIcon;
 }
开发者ID:PhannGor,项目名称:unity3d-rainbow-folders,代码行数:7,代码来源:RainbowFolder.cs

示例5: Key

 public Key(double time, double value, KeyType inFunction, BaseTweenType baseTweenType)
 {
     Time = time;
     Value = value;
     InFunction = inFunction;
     BaseTweenType = baseTweenType;
 }
开发者ID:bluephoton,项目名称:wwt-windows-client,代码行数:7,代码来源:Key.cs

示例6: OnKeyEvent

 /// <inheritdoc/>>
 public bool OnKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey)
 {
     bool result = false;
     Debug.WriteLine(String.Format("OnKeyEvent: KeyType: {0} 0x{1:X} Modifiers: {2}", type, windowsKeyCode, modifiers));
     // TODO: Handle MessageNeeded cases here somehow.
     return result;
 }
开发者ID:klkn,项目名称:CefSharp,代码行数:8,代码来源:KeyboardHandler.cs

示例7: KeyEventArgs

 public KeyEventArgs(int scanCode, KeyType type, int value, int timeStamp)
 {
     ScanCode = scanCode;
     Type = type;
     Value = value;
     TimeStamp = timeStamp;
 }
开发者ID:nico-izo,项目名称:KOIB,代码行数:7,代码来源:KeyEventArgs.cs

示例8: Retrieve

		public static byte[] Retrieve (KeyType kt)
		{
			string key = null;
			
			switch (kt) {
				case KeyType.Validation:
					key = keyValidation;
					break;

				case KeyType.Encryption:
					key = keyEncryption;
					break;

				default:
					throw new ArgumentException ("Unknown key type.");
			}

			if (key == null)
				return null;
			
			object o = null;

			try {
				RegistryKey v = OpenRegistryKey (key, false);
				o = v.GetValue ("AutoGenKey", null);
			} catch (Exception) {
				return null;
			}

			if (o == null || o.GetType () != typeof (byte[]))
				return null;
			return (byte[]) o;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:33,代码来源:MachineKeyRegistryStorage.cs

示例9: KeyActionConfig

	public KeyActionConfig(KeyType type, int order, Action down, Action up)
	{
		Category = type;
        Order = order;
		KeyDownAction = down;
		KeyUpAction = up;
	}
开发者ID:RomainVivier,项目名称:Unity-KeyBinder,代码行数:7,代码来源:ActionConfig.cs

示例10: AddIconByKeyType

    public void AddIconByKeyType(KeyType keyType)
    {
        GameObject prefab = null;

        switch (keyType)
        {
            case KeyType.A:
                prefab = plantIcon;
                break;
            case KeyType.B:
                prefab = boneIcon;
                break;
            case KeyType.C:
                prefab = mineralIcon;
                break;
            case KeyType.D:
                prefab = fluidIcon;
                break;
        }

        if (prefab != null)
        {
            // set prefab position
            prefab.transform.position = new Vector3
            (
                transform.position.x + (_icons.Count - 1),
                transform.position.y,
                transform.position.z + (_icons.Count - 1)
            );
            
            GameObject newIcon = Instantiate(prefab);
            _icons.Add(newIcon);
        }
    }
开发者ID:shingokko,项目名称:combocannon,代码行数:34,代码来源:CannonContentsDisplay.cs

示例11: ArrowComponent

 public ArrowComponent(GameObject parent)
     : base(parent)
 {
     arrowKey = ArrowType.None;
     keyTimer = 0;
     keyPressed = KeyType.None;
 }
开发者ID:patpaquette,项目名称:SSB-clone,代码行数:7,代码来源:ArrowComponent.cs

示例12: ProtocolKeyAttribute

 public ProtocolKeyAttribute(string name, string defaultValue, KeyUsagePhase phase, KeySender sender, KeyType type)
 {
     _name = name;
     _default = defaultValue;
     _phase = phase;
     _sender = sender;
     _type = type;
 }
开发者ID:marinehero,项目名称:ThinkAway.net,代码行数:8,代码来源:ProtocolKeyAttribute.cs

示例13: KeyInfo

		public KeyInfo( Key key )
		{
			m_KeyVal = key.KeyValue;
			m_Description = key.Description;
			m_MaxRange = key.MaxRange;
			m_Link = key.Link;
			m_Type = (KeyType)key.ItemID;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:8,代码来源:KeyRing.cs

示例14: Key

 /// <summary>
 /// Initializes a new instance of the <see cref="Key"/> class.
 /// </summary>
 public Key(char key)
 {
     keyType = KeyType.RegularKey;
     character = key;
     control = false;
     alt = false;
     shift = char.IsUpper(key);
 }
开发者ID:hj1980,项目名称:Mosa,代码行数:11,代码来源:Key.cs

示例15: GetKey

 static int GetKey(KeyType keyType, ushort length, byte dec)
 {
     var result = 0;
     result |= (int)keyType << 24;
     result |= (int)dec << 16;
     result |= length;
     return result;
 }
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:8,代码来源:ConverterDictionary.cs


注:本文中的KeyType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。