本文整理汇总了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;
}
示例2: KeySequence
public KeySequence(string name, KeyType[] keys, Element prim, Element sec) {
this.name = name;
_keys = keys;
Primary = prim;
Secondary = sec;
}
示例3: EntityKey
public EntityKey(string value, KeyType type)
{
if (value == null) throw new ArgumentNullException("key");
_value = value;
_hashedValue = EntityBuilder.Fnv1Hash(_value);
_type = type;
}
示例4: RainbowFolder
public RainbowFolder(KeyType type, string key, Texture2D smallIcon, Texture2D largeIcon)
{
Type = type;
Key = key;
SmallIcon = smallIcon;
LargeIcon = largeIcon;
}
示例5: Key
public Key(double time, double value, KeyType inFunction, BaseTweenType baseTweenType)
{
Time = time;
Value = value;
InFunction = inFunction;
BaseTweenType = baseTweenType;
}
示例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;
}
示例7: KeyEventArgs
public KeyEventArgs(int scanCode, KeyType type, int value, int timeStamp)
{
ScanCode = scanCode;
Type = type;
Value = value;
TimeStamp = timeStamp;
}
示例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;
}
示例9: KeyActionConfig
public KeyActionConfig(KeyType type, int order, Action down, Action up)
{
Category = type;
Order = order;
KeyDownAction = down;
KeyUpAction = up;
}
示例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);
}
}
示例11: ArrowComponent
public ArrowComponent(GameObject parent)
: base(parent)
{
arrowKey = ArrowType.None;
keyTimer = 0;
keyPressed = KeyType.None;
}
示例12: ProtocolKeyAttribute
public ProtocolKeyAttribute(string name, string defaultValue, KeyUsagePhase phase, KeySender sender, KeyType type)
{
_name = name;
_default = defaultValue;
_phase = phase;
_sender = sender;
_type = type;
}
示例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;
}
示例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);
}
示例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;
}