EyeAuras Docs EyeAuras Docs
EyeAuras Docs EyeAuras Docs
DocFX + Singulink = ♥

Search Results for

    Class KeybindAttribute

    Specifies that a method should be invoked when a specific hotkey is pressed.

    Inheritance
    object
    Attribute
    KeybindAttribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.GetType()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: EyeAuras.Scripting.Api
    Assembly: EyeAuras.Scripting.dll
    Syntax
    [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
    public sealed class KeybindAttribute : Attribute
    Remarks

    This attribute is designed to simplify hotkey handling in scripts by allowing developers to decorate methods with hotkey definitions. Each decorated method will be automatically registered as a hotkey action when the script is initialized.

    Supported hotkeys can include:

    • Single keys (e.g., "A", "F5", "Esc").
    • Key combinations with modifiers (e.g., "Ctrl+Shift+P", "Alt+Enter").
    • Special keys like "VolumeUp", "MediaPlayPause", etc.

    **Suppression Behavior:** By default, the associated hotkey event is suppressed, meaning the key's default behavior (e.g., opening the Start menu for the Windows key) will be blocked. You can change this by setting SuppressKey to `false`.

    **Modifier Handling:** By default, the attribute ignores modifier keys unless explicitly included in the `Hotkey` string. If IgnoreModifiers is set to `true`, the hotkey will trigger regardless of any active modifiers.

    **Multiple Attributes:** You can apply multiple `RunOnKeyPressAttribute` attributes to the same method, allowing the method to respond to different hotkeys.

    public class MyScript
    {
        [RunOnKeyPress("Ctrl+Shift+P")]
        public void OpenPanel()
        {
            Console.WriteLine("Opening panel...");
        }
    
    [RunOnKeyPress("F1", SuppressKey = false)]
    public void ShowHelp()
    {
        Console.WriteLine("Displaying help...");
    }
    
    [RunOnKeyPress("T", IgnoreModifiers = true)]
    public void DebugTrace()
    {
        Console.WriteLine("Debug trace active.");
    }
    

    }

    **Important Notes:** - Hotkey definitions are case-insensitive. - Invalid or unsupported hotkeys will result in runtime exceptions during registration. - Ensure that conflicting hotkeys are avoided to prevent unexpected behavior.

    Constructors

    Name Description
    KeybindAttribute()
    KeybindAttribute(string)

    Properties

    Name Description
    ActivationType

    Specifies when the keybind should trigger: on key press (KeyDown), on key release (KeyUp), or both.

    Hotkey

    The hotkey gesture that activates this trigger.

    IgnoreModifiers

    Specifies whether modifier keys (Ctrl, Alt, Shift) are ignored in the hotkey trigger.

    SuppressKey

    Determines whether the hotkey event is suppressed after being triggered.

    Methods

    Name Description
    Equals(object)
    GetHashCode()
    ToString()

    Extension Methods

    ObjectExtensions.AddTo<TItem, TCollection>(TItem, ISourceList<TCollection>)
    ObjectExtensions.AddTo<TItem, TCollection>(TItem, ICollection<TCollection>)
    ObjectExtensions.CloneJson<T>(T)
    ObjectExtensions.CopyPropertiesTo<TSource, TTarget>(TSource, TTarget)
    ObjectExtensions.DumpToJson<T>(T)
    ObjectExtensions.DumpToTextRaw<T>(T)
    ObjectExtensions.DumpToText<T>(T)
    ObjectExtensions.Dump<T>(T)
    ObjectExtensions.EvalOrDefault<T, TValue>(T, Func<T, TValue>, TValue)
    ObjectExtensions.Eval<T, TValue>(T, Func<T, TValue>)
    ObjectExtensions.GetPropertyAccessor<TSource, TValue>(TSource, Expression<Func<TSource, TValue>>)
    ObjectExtensions.InsertTo<TItem, TCollection>(TItem, IList<TCollection>, int)
    ObjectExtensions.ToJson<T>(T, Formatting)
    ObjectExtensions.ToStringSafe<T>(T)
    ObjectExtensions.TransferPropertiesTo<TSource, TTarget>(TSource, TTarget, params string[])
    ObjectExtensions.WaitForAsync<TObject, T1>(TObject, Func<TObject, T1>, Predicate<T1>, TimeSpan, int)
    XDocumentExtensions.AddTo<T>(T, XContainer)
    ObjectExtensions.GetPropertyAccessor<TValue>(object, string)
    ObjectReflectionExtensions.GetPropertyTypeOrDefault(object, string)
    ObjectReflectionExtensions.GetPropertyValue<T>(object, string)
    ObjectReflectionExtensions.SetPropertyValue<T>(object, string, T)
    2025 © Xab3r. All rights reserved.