Beispiel #1
0
 public static partial IntPtr ulCreateKeyEvent(
     ULKeyEventType type,
     ULKeyEventModifiers modifiers,
     int virtual_key_code, int native_key_code,
     [MarshalUsing(typeof(ULStringGeneratedDllImportMarshaler))] string text, [MarshalUsing(typeof(ULStringGeneratedDllImportMarshaler))] string unmodified_text,
     [MarshalAs(UnmanagedType.I1)] bool is_keypad,
     [MarshalAs(UnmanagedType.I1)] bool is_auto_repeat,
     [MarshalAs(UnmanagedType.I1)] bool is_system_key);
Beispiel #2
0
        /// <param name="type">Type of event</param>
        /// <param name="modifiers">Modifiers</param>
        /// <param name="virtual_key_code"><see cref="ULKeyCodes"/></param>
        /// <param name="native_key_code">Native key code, set it to 0, if you don't know where get it</param>
        /// <param name="text">Text generated by keyboard, usually single character</param>
        /// <param name="unmodified_text">set it to same value as "text"</param>
        /// <param name="is_keypad">Is Key Pad event</param>
        /// <param name="is_auto_repeat">Enable autorepeat</param>
        /// <param name="is_system_key">Is system key<br/>Windows only</param>
        public ULKeyEvent(ULKeyEventType type, ULKeyEventModifiers modifiers, int virtual_key_code, int native_key_code, string text, string unmodified_text, bool is_keypad, bool is_auto_repeat, bool is_system_key)
        {
            // prevent AccessViolationException
            if (text is null)
            {
                throw new ArgumentNullException(nameof(text));
            }

            Ptr = Methods.ulCreateKeyEvent(type, modifiers, virtual_key_code, native_key_code, text, unmodified_text, is_keypad, is_auto_repeat, is_system_key);
        }