Something went wrong. Try again.
.NET bindings for Terminus
Something went wrong. Try again.
Terminus.NET Key.cs
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253namespace Terminus;using System.Text;
/// <summary>/// A key pressed on the keyboard./// </summary>[StructLayout(LayoutKind.Sequential)]public struct KeyPress{ /// <summary> /// The value of the key that was pressed. /// </summary> public uint Key;
/// <summary> /// The key modifier pressed (ctrl, alt, etc.) /// </summary> public ushort Modifier;
/// <summary> /// The Unicode scalar of the key being pressed. /// </summary> public uint Character;
/// <summary> /// Convert the key press to a <see cref="Rune" />. /// </summary> public Rune ToRune() { return new Rune(Character); }
/// <summary> /// Convert the key press to a string, with a conversion to <see cref="Rune" /> as an intermediary. /// </summary> public override string ToString() { return ToRune().ToString(); }
/// public static implicit operator Rune(KeyPress k) { return new Rune(k.Character); }
/// public static implicit operator Cell(KeyPress k) { return new Cell(k.Character, Color.White, Color.Black, Style.Normal); }}