| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // Input.cs
- //
- // Copyright 2015 Xamarin Inc. All rights reserved.
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using Urho.Urho2D;
- using Urho.Gui;
- using Urho.Resources;
- using Urho.IO;
- using Urho.Navigation;
- using Urho.Network;
- namespace Urho
- {
- /// <summary>
- /// %Input subsystem. Converts operating system window messages to input state and events.
- /// </summary>
- public unsafe partial class Input : UrhoObject
- {
- unsafe partial void OnInputCreated ();
- [Preserve]
- public Input (IntPtr handle) : base (handle)
- {
- OnInputCreated ();
- }
- [Preserve]
- protected Input (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnInputCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetType (IntPtr handle);
- private StringHash UrhoGetType ()
- {
- Runtime.ValidateRefCounted (this);
- return new StringHash (Input_GetType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_GetTypeName (IntPtr handle);
- private string GetTypeName ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Input_GetTypeName (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetTypeStatic ();
- private static StringHash GetTypeStatic ()
- {
- Runtime.Validate (typeof(Input));
- return new StringHash (Input_GetTypeStatic ());
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_GetTypeNameStatic ();
- private static string GetTypeNameStatic ()
- {
- Runtime.Validate (typeof(Input));
- return Marshal.PtrToStringAnsi (Input_GetTypeNameStatic ());
- }
- [Preserve]
- public Input () : this (Application.CurrentContext)
- {
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_Input (IntPtr context);
- [Preserve]
- public Input (Context context) : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(Input));
- handle = Input_Input ((object)context == null ? IntPtr.Zero : context.Handle);
- Runtime.RegisterObject (this);
- OnInputCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_Update (IntPtr handle);
- /// <summary>
- /// Poll for window messages. Called by HandleBeginFrame().
- /// </summary>
- public void Update ()
- {
- Runtime.ValidateRefCounted (this);
- Input_Update (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetToggleFullscreen (IntPtr handle, bool enable);
- /// <summary>
- /// Set whether ALT-ENTER fullscreen toggle is enabled.
- /// </summary>
- private void SetToggleFullscreen (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetToggleFullscreen (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetMouseVisible (IntPtr handle, bool enable, bool suppressEvent);
- /// <summary>
- /// Set whether the operating system mouse cursor is visible. When not visible (default), is kept centered to prevent leaving the window. Mouse visibility event can be suppressed-- this also recalls any unsuppressed SetMouseVisible which can be returned by ResetMouseVisible().
- /// </summary>
- public void SetMouseVisible (bool enable, bool suppressEvent = false)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetMouseVisible (handle, enable, suppressEvent);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_ResetMouseVisible (IntPtr handle);
- /// <summary>
- /// Reset last mouse visibility that was not suppressed in SetMouseVisible.
- /// </summary>
- public void ResetMouseVisible ()
- {
- Runtime.ValidateRefCounted (this);
- Input_ResetMouseVisible (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetMouseGrabbed (IntPtr handle, bool grab, bool suppressEvent);
- /// <summary>
- /// Set whether the mouse is currently being grabbed by an operation.
- /// </summary>
- public void SetMouseGrabbed (bool grab, bool suppressEvent = false)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetMouseGrabbed (handle, grab, suppressEvent);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_ResetMouseGrabbed (IntPtr handle);
- /// <summary>
- /// Reset the mouse grabbed to the last unsuppressed SetMouseGrabbed call
- /// </summary>
- public void ResetMouseGrabbed ()
- {
- Runtime.ValidateRefCounted (this);
- Input_ResetMouseGrabbed (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetMouseMode (IntPtr handle, MouseMode mode, bool suppressEvent);
- /// <summary>
- /// Set the mouse mode.
- /// Set the mouse mode behaviour.
- /// MM_ABSOLUTE is the default behaviour, allowing the toggling of operating system cursor visibility and allowing the cursor to escape the window when visible.
- /// When the operating system cursor is invisible in absolute mouse mode, the mouse is confined to the window.
- /// If the operating system and UI cursors are both invisible, interaction with the Urho UI will be limited (eg: drag move / drag end events will not trigger).
- /// SetMouseMode(MM_ABSOLUTE) will call SetMouseGrabbed(false).
- /// MM_RELATIVE sets the operating system cursor to invisible and confines the cursor to the window.
- /// The operating system cursor cannot be set to be visible in this mode via SetMouseVisible(), however changes are tracked and will be restored when another mouse mode is set.
- /// When the virtual cursor is also invisible, UI interaction will still function as normal (eg: drag events will trigger).
- /// SetMouseMode(MM_RELATIVE) will call SetMouseGrabbed(true).
- /// MM_WRAP grabs the mouse from the operating system and confines the operating system cursor to the window, wrapping the cursor when it is near the edges.
- /// SetMouseMode(MM_WRAP) will call SetMouseGrabbed(true).
- /// MM_FREE does not grab/confine the mouse cursor even when it is hidden. This can be used for cases where the cursor should render using the operating system
- /// outside the window, and perform custom rendering (with SetMouseVisible(false)) inside.
- /// </summary>
- public void SetMouseMode (MouseMode mode, bool suppressEvent = false)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetMouseMode (handle, mode, suppressEvent);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_ResetMouseMode (IntPtr handle);
- /// <summary>
- /// Reset the last mouse mode that wasn't suppressed in SetMouseMode
- /// </summary>
- public void ResetMouseMode ()
- {
- Runtime.ValidateRefCounted (this);
- Input_ResetMouseMode (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_AddScreenJoystick (IntPtr handle, IntPtr layoutFile, IntPtr styleFile);
- /// <summary>
- /// Add screen joystick.
- /// Return the joystick instance ID when successful or negative on error.
- /// If layout file is not given, use the default screen joystick layout.
- /// If style file is not given, use the default style file from root UI element.
- /// This method should only be called in main thread.
- /// </summary>
- public int AddScreenJoystick (Urho.Resources.XmlFile layoutFile = null, Urho.Resources.XmlFile styleFile = null)
- {
- Runtime.ValidateRefCounted (this);
- return Input_AddScreenJoystick (handle, (object)layoutFile == null ? IntPtr.Zero : layoutFile.Handle, (object)styleFile == null ? IntPtr.Zero : styleFile.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_RemoveScreenJoystick (IntPtr handle, int id);
- /// <summary>
- /// Remove screen joystick by instance ID.
- /// Return true if successful.
- /// This method should only be called in main thread.
- /// </summary>
- public bool RemoveScreenJoystick (int id)
- {
- Runtime.ValidateRefCounted (this);
- return Input_RemoveScreenJoystick (handle, id);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetScreenJoystickVisible (IntPtr handle, int id, bool enable);
- /// <summary>
- /// Set whether the virtual joystick is visible.
- /// </summary>
- public void SetScreenJoystickVisible (int id, bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetScreenJoystickVisible (handle, id, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetScreenKeyboardVisible (IntPtr handle, bool enable);
- /// <summary>
- /// Show or hide on-screen keyboard on platforms that support it. When shown, keypresses from it are delivered as key events.
- /// </summary>
- private void SetScreenKeyboardVisible (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetScreenKeyboardVisible (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetTouchEmulation (IntPtr handle, bool enable);
- /// <summary>
- /// Set touch emulation by mouse. Only available on desktop platforms. When enabled, actual mouse events are no longer sent and the mouse cursor is forced visible.
- /// </summary>
- private void SetTouchEmulation (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetTouchEmulation (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetEnabled (IntPtr handle, bool enable);
- /// <summary>
- /// Enabled or disable Input
- /// </summary>
- private void SetEnabled (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetEnabled (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_RecordGesture (IntPtr handle);
- /// <summary>
- /// Begin recording a touch gesture. Return true if successful. The E_GESTURERECORDED event (which contains the ID for the new gesture) will be sent when recording finishes.
- /// </summary>
- public bool RecordGesture ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_RecordGesture (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_SaveGestures_File (IntPtr handle, IntPtr dest);
- /// <summary>
- /// Save all in-memory touch gestures. Return true if successful.
- /// </summary>
- public bool SaveGestures (File dest)
- {
- Runtime.ValidateRefCounted (this);
- return Input_SaveGestures_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_SaveGestures_MemoryBuffer (IntPtr handle, IntPtr dest);
- /// <summary>
- /// Save all in-memory touch gestures. Return true if successful.
- /// </summary>
- public bool SaveGestures (MemoryBuffer dest)
- {
- Runtime.ValidateRefCounted (this);
- return Input_SaveGestures_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_SaveGesture_File (IntPtr handle, IntPtr dest, uint gestureID);
- /// <summary>
- /// Save a specific in-memory touch gesture to a file. Return true if successful.
- /// </summary>
- public bool SaveGesture (File dest, uint gestureID)
- {
- Runtime.ValidateRefCounted (this);
- return Input_SaveGesture_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, gestureID);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_SaveGesture_MemoryBuffer (IntPtr handle, IntPtr dest, uint gestureID);
- /// <summary>
- /// Save a specific in-memory touch gesture to a file. Return true if successful.
- /// </summary>
- public bool SaveGesture (MemoryBuffer dest, uint gestureID)
- {
- Runtime.ValidateRefCounted (this);
- return Input_SaveGesture_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, gestureID);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Input_LoadGestures_File (IntPtr handle, IntPtr source);
- /// <summary>
- /// Load touch gestures from a file. Return number of loaded gestures, or 0 on failure.
- /// </summary>
- public uint LoadGestures (File source)
- {
- Runtime.ValidateRefCounted (this);
- return Input_LoadGestures_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Input_LoadGestures_MemoryBuffer (IntPtr handle, IntPtr source);
- /// <summary>
- /// Load touch gestures from a file. Return number of loaded gestures, or 0 on failure.
- /// </summary>
- public uint LoadGestures (MemoryBuffer source)
- {
- Runtime.ValidateRefCounted (this);
- return Input_LoadGestures_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_RemoveGesture (IntPtr handle, uint gestureID);
- /// <summary>
- /// Remove an in-memory gesture by ID. Return true if was found.
- /// </summary>
- public bool RemoveGesture (uint gestureID)
- {
- Runtime.ValidateRefCounted (this);
- return Input_RemoveGesture (handle, gestureID);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_RemoveAllGestures (IntPtr handle);
- /// <summary>
- /// Remove all in-memory gestures.
- /// </summary>
- public void RemoveAllGestures ()
- {
- Runtime.ValidateRefCounted (this);
- Input_RemoveAllGestures (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_SetMousePosition (IntPtr handle, ref Urho.IntVector2 position);
- /// <summary>
- /// Set the mouse cursor position. Uses the backbuffer (Graphics width/height) coordinates.
- /// </summary>
- public void SetMousePosition (Urho.IntVector2 position)
- {
- Runtime.ValidateRefCounted (this);
- Input_SetMousePosition (handle, ref position);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Input_CenterMousePosition (IntPtr handle);
- /// <summary>
- /// Center the mouse position.
- /// </summary>
- public void CenterMousePosition ()
- {
- Runtime.ValidateRefCounted (this);
- Input_CenterMousePosition (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetKeyFromName (IntPtr handle, string name);
- /// <summary>
- /// Return keycode from key name.
- /// </summary>
- public int GetKeyFromName (string name)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetKeyFromName (handle, name);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetKeyFromScancode (IntPtr handle, int scancode);
- /// <summary>
- /// Return keycode from scancode.
- /// </summary>
- public int GetKeyFromScancode (int scancode)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetKeyFromScancode (handle, scancode);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_GetKeyName (IntPtr handle, int key);
- /// <summary>
- /// Return name of key from keycode.
- /// </summary>
- public string GetKeyName (Key key)
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Input_GetKeyName (handle, (int)key));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetScancodeFromKey (IntPtr handle, int key);
- /// <summary>
- /// Return scancode from keycode.
- /// </summary>
- public int GetScancodeFromKey (Key key)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetScancodeFromKey (handle, (int)key);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetScancodeFromName (IntPtr handle, string name);
- /// <summary>
- /// Return scancode from key name.
- /// </summary>
- public int GetScancodeFromName (string name)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetScancodeFromName (handle, name);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_GetScancodeName (IntPtr handle, int scancode);
- /// <summary>
- /// Return name of key from scancode.
- /// </summary>
- public string GetScancodeName (int scancode)
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Input_GetScancodeName (handle, scancode));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetKeyDown (IntPtr handle, int key);
- /// <summary>
- /// Check if a key is held down.
- /// </summary>
- public bool GetKeyDown (Key key)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetKeyDown (handle, (int)key);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetKeyPress (IntPtr handle, int key);
- /// <summary>
- /// Check if a key has been pressed on this frame.
- /// </summary>
- public bool GetKeyPress (Key key)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetKeyPress (handle, (int)key);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetScancodeDown (IntPtr handle, int scancode);
- /// <summary>
- /// Check if a key is held down by scancode.
- /// </summary>
- public bool GetScancodeDown (int scancode)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetScancodeDown (handle, scancode);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetScancodePress (IntPtr handle, int scancode);
- /// <summary>
- /// Check if a key has been pressed on this frame by scancode.
- /// </summary>
- public bool GetScancodePress (int scancode)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetScancodePress (handle, scancode);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetMouseButtonDown (IntPtr handle, int button);
- /// <summary>
- /// Check if a mouse button is held down.
- /// </summary>
- public bool GetMouseButtonDown (MouseButton button)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseButtonDown (handle, (int)button);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetMouseButtonPress (IntPtr handle, int button);
- /// <summary>
- /// Check if a mouse button has been pressed on this frame.
- /// </summary>
- public bool GetMouseButtonPress (MouseButton button)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseButtonPress (handle, (int)button);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetQualifierDown (IntPtr handle, int qualifier);
- /// <summary>
- /// Check if a qualifier key is held down.
- /// </summary>
- public bool GetQualifierDown (int qualifier)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetQualifierDown (handle, qualifier);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetQualifierPress (IntPtr handle, int qualifier);
- /// <summary>
- /// Check if a qualifier key has been pressed on this frame.
- /// </summary>
- public bool GetQualifierPress (int qualifier)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetQualifierPress (handle, qualifier);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetQualifiers (IntPtr handle);
- /// <summary>
- /// Return the currently held down qualifiers.
- /// </summary>
- private int GetQualifiers ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetQualifiers (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.IntVector2 Input_GetMousePosition (IntPtr handle);
- /// <summary>
- /// Return mouse position within window. Should only be used with a visible mouse cursor. Uses the backbuffer (Graphics width/height) coordinates.
- /// </summary>
- private Urho.IntVector2 GetMousePosition ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMousePosition (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.IntVector2 Input_GetMouseMove (IntPtr handle);
- /// <summary>
- /// Return mouse movement since last frame.
- /// </summary>
- private Urho.IntVector2 GetMouseMove ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseMove (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetMouseMoveX (IntPtr handle);
- /// <summary>
- /// Return horizontal mouse movement since last frame.
- /// </summary>
- private int GetMouseMoveX ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseMoveX (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetMouseMoveY (IntPtr handle);
- /// <summary>
- /// Return vertical mouse movement since last frame.
- /// </summary>
- private int GetMouseMoveY ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseMoveY (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Input_GetMouseMoveWheel (IntPtr handle);
- /// <summary>
- /// Return mouse wheel movement since last frame.
- /// </summary>
- private int GetMouseMoveWheel ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseMoveWheel (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Vector2 Input_GetInputScale (IntPtr handle);
- /// <summary>
- /// Return input coordinate scaling. Should return non-unity on High DPI display.
- /// </summary>
- private Vector2 GetInputScale ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetInputScale (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Input_GetNumTouches (IntPtr handle);
- /// <summary>
- /// Return number of active finger touches.
- /// </summary>
- private uint GetNumTouches ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetNumTouches (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Input_GetTouch (IntPtr handle, uint index);
- /// <summary>
- /// Return active finger touch by index.
- /// </summary>
- public TouchState GetTouch (uint index)
- {
- Runtime.ValidateRefCounted (this);
- return (TouchState)Marshal.PtrToStructure (Input_GetTouch (handle, index), typeof(TouchState));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Input_GetNumJoysticks (IntPtr handle);
- /// <summary>
- /// Return number of connected joysticks.
- /// </summary>
- private uint GetNumJoysticks ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetNumJoysticks (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern JoystickState* Input_GetJoystick (IntPtr handle, int id);
- /// <summary>
- /// Return joystick state by ID, or null if does not exist.
- /// </summary>
- public JoystickState* GetJoystick (int id)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetJoystick (handle, id);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern JoystickState* Input_GetJoystickByIndex (IntPtr handle, uint index);
- /// <summary>
- /// Return joystick state by index, or null if does not exist. 0 = first connected joystick.
- /// </summary>
- public JoystickState* GetJoystickByIndex (uint index)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetJoystickByIndex (handle, index);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern JoystickState* Input_GetJoystickByName (IntPtr handle, string name);
- /// <summary>
- /// Return joystick state by name, or null if does not exist.
- /// </summary>
- public JoystickState* GetJoystickByName (string name)
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetJoystickByName (handle, name);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetToggleFullscreen (IntPtr handle);
- /// <summary>
- /// Return whether fullscreen toggle is enabled.
- /// </summary>
- private bool GetToggleFullscreen ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetToggleFullscreen (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsScreenJoystickVisible (IntPtr handle, int id);
- /// <summary>
- /// Return whether a virtual joystick is visible.
- /// </summary>
- public bool IsScreenJoystickVisible (int id)
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsScreenJoystickVisible (handle, id);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetScreenKeyboardSupport (IntPtr handle);
- /// <summary>
- /// Return whether on-screen keyboard is supported.
- /// </summary>
- private bool GetScreenKeyboardSupport ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetScreenKeyboardSupport (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsScreenKeyboardVisible (IntPtr handle);
- /// <summary>
- /// Return whether on-screen keyboard is being shown.
- /// </summary>
- private bool IsScreenKeyboardVisible ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsScreenKeyboardVisible (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_GetTouchEmulation (IntPtr handle);
- /// <summary>
- /// Return whether touch emulation is enabled.
- /// </summary>
- private bool GetTouchEmulation ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetTouchEmulation (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsMouseVisible (IntPtr handle);
- /// <summary>
- /// Return whether the operating system mouse cursor is visible.
- /// </summary>
- private bool IsMouseVisible ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsMouseVisible (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsMouseGrabbed (IntPtr handle);
- /// <summary>
- /// Return whether the mouse is currently being grabbed by an operation.
- /// </summary>
- private bool IsMouseGrabbed ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsMouseGrabbed (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsMouseLocked (IntPtr handle);
- /// <summary>
- /// Return whether the mouse is locked to the window
- /// </summary>
- private bool IsMouseLocked ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsMouseLocked (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern MouseMode Input_GetMouseMode (IntPtr handle);
- /// <summary>
- /// Return the mouse mode.
- /// </summary>
- private MouseMode GetMouseMode ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_GetMouseMode (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_HasFocus (IntPtr handle);
- /// <summary>
- /// Return whether application window has input focus.
- /// </summary>
- public bool HasFocus ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_HasFocus (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsEnabled (IntPtr handle);
- /// <summary>
- /// Return whether Input is enabled.
- /// </summary>
- private bool IsEnabled ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsEnabled (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Input_IsMinimized (IntPtr handle);
- /// <summary>
- /// Return whether application window is minimized.
- /// </summary>
- private bool IsMinimized ()
- {
- Runtime.ValidateRefCounted (this);
- return Input_IsMinimized (handle);
- }
- public override StringHash Type {
- get {
- return UrhoGetType ();
- }
- }
- public override string TypeName {
- get {
- return GetTypeName ();
- }
- }
- [Preserve]
- public static StringHash TypeStatic {
- get {
- return GetTypeStatic ();
- }
- }
- public static string TypeNameStatic {
- get {
- return GetTypeNameStatic ();
- }
- }
- /// <summary>
- /// Return whether fullscreen toggle is enabled.
- /// Or
- /// Set whether ALT-ENTER fullscreen toggle is enabled.
- /// </summary>
- public bool ToggleFullscreen {
- get {
- return GetToggleFullscreen ();
- }
- set {
- SetToggleFullscreen (value);
- }
- }
- /// <summary>
- /// Return whether on-screen keyboard is being shown.
- /// Or
- /// Show or hide on-screen keyboard on platforms that support it. When shown, keypresses from it are delivered as key events.
- /// </summary>
- public bool ScreenKeyboardVisible {
- get {
- return IsScreenKeyboardVisible ();
- }
- set {
- SetScreenKeyboardVisible (value);
- }
- }
- /// <summary>
- /// Return whether touch emulation is enabled.
- /// Or
- /// Set touch emulation by mouse. Only available on desktop platforms. When enabled, actual mouse events are no longer sent and the mouse cursor is forced visible.
- /// </summary>
- public bool TouchEmulation {
- get {
- return GetTouchEmulation ();
- }
- set {
- SetTouchEmulation (value);
- }
- }
- /// <summary>
- /// Return whether Input is enabled.
- /// Or
- /// Enabled or disable Input
- /// </summary>
- public bool Enabled {
- get {
- return IsEnabled ();
- }
- set {
- SetEnabled (value);
- }
- }
- /// <summary>
- /// Return mouse position within window. Should only be used with a visible mouse cursor. Uses the backbuffer (Graphics width/height) coordinates.
- /// </summary>
- public Urho.IntVector2 MousePosition {
- get {
- return GetMousePosition ();
- }
- }
- /// <summary>
- /// Return the currently held down qualifiers.
- /// </summary>
- public int Qualifiers {
- get {
- return GetQualifiers ();
- }
- }
- /// <summary>
- /// Return mouse movement since last frame.
- /// </summary>
- public Urho.IntVector2 MouseMove {
- get {
- return GetMouseMove ();
- }
- }
- /// <summary>
- /// Return horizontal mouse movement since last frame.
- /// </summary>
- public int MouseMoveX {
- get {
- return GetMouseMoveX ();
- }
- }
- /// <summary>
- /// Return vertical mouse movement since last frame.
- /// </summary>
- public int MouseMoveY {
- get {
- return GetMouseMoveY ();
- }
- }
- /// <summary>
- /// Return mouse wheel movement since last frame.
- /// </summary>
- public int MouseMoveWheel {
- get {
- return GetMouseMoveWheel ();
- }
- }
- /// <summary>
- /// Return input coordinate scaling. Should return non-unity on High DPI display.
- /// </summary>
- public Vector2 InputScale {
- get {
- return GetInputScale ();
- }
- }
- /// <summary>
- /// Return number of active finger touches.
- /// </summary>
- public uint NumTouches {
- get {
- return GetNumTouches ();
- }
- }
- /// <summary>
- /// Return number of connected joysticks.
- /// </summary>
- public uint NumJoysticks {
- get {
- return GetNumJoysticks ();
- }
- }
- /// <summary>
- /// Return whether on-screen keyboard is supported.
- /// </summary>
- public bool ScreenKeyboardSupport {
- get {
- return GetScreenKeyboardSupport ();
- }
- }
- /// <summary>
- /// Return whether the operating system mouse cursor is visible.
- /// </summary>
- public bool MouseVisible {
- get {
- return IsMouseVisible ();
- }
- }
- /// <summary>
- /// Return whether the mouse is currently being grabbed by an operation.
- /// </summary>
- public bool MouseGrabbed {
- get {
- return IsMouseGrabbed ();
- }
- }
- /// <summary>
- /// Return whether the mouse is locked to the window
- /// </summary>
- public bool MouseLocked {
- get {
- return IsMouseLocked ();
- }
- }
- /// <summary>
- /// Return the mouse mode.
- /// </summary>
- public MouseMode MouseMode {
- get {
- return GetMouseMode ();
- }
- }
- /// <summary>
- /// Return whether application window is minimized.
- /// </summary>
- public bool Minimized {
- get {
- return IsMinimized ();
- }
- }
- }
- }
|