/// <summary> /// c'tor for transition keys with a texture. /// </summary> /// <param name="parent"></param> /// <param name="position" /// <param name="size" /// <param name="texture"></param> /// <param name="keyCapColor"></param> /// <param name="OnKey"></param> public Key(KeySet parent, Vector2 position, Vector2 size, Texture2D texture, Color labelColor, Color keyCapColor, OnKeyDelegate OnKey) { this.parent = parent; this.position = position; this.size = size; this.texture = texture; this.labelColor = labelColor; this.keyCapColor = keyCapColor; this.OnKey = OnKey; }
public Task RemoveKeyHook(OnKeyDelegate onDown, OnKeyDelegate onUp) { return(Task.Delay(0).ContinueWith((t) => { lock (this) { onKeyDn.Remove(onDown); onKeyUp.Remove(onUp); } })); }
/// <summary> /// c'tor for keys which cause a transition. Transition can be to another KeySet /// or to deactivate the virtual keyboard. /// </summary> /// <param name="parent"></param> /// <param name="position" /// <param name="size" /// <param name="label"></param> /// <param name="Font"></param> /// <param name="keyCapColor"></param> /// <param name="OnKey"></param> public Key(KeySet parent, Vector2 position, Vector2 size, string label, UI2D.Shared.GetFont Font, Color labelColor, Color keyCapColor, OnKeyDelegate OnKey) { this.parent = parent; this.position = position; this.size = size; this.label = label; this.Font = Font; this.labelColor = labelColor; this.keyCapColor = keyCapColor; this.OnKey = OnKey; }
public void AddKeyHook(OnKeyDelegate onDown, OnKeyDelegate onUp) { Task.Delay(0).ContinueWith((t) => { lock (this) { onKeyDn.AddLast(onDown); onKeyUp.AddLast(onUp); } }); }