| 4 | namespace MyGUI.Sharp |
| 5 | { |
| 6 | public class InputManager |
| 7 | { |
| 8 | #region Instance |
| 9 | |
| 10 | private static InputManager mInstance = new InputManager(); |
| 11 | |
| 12 | public static InputManager Instance |
| 13 | { |
| 14 | get { return mInstance; } |
| 15 | } |
| 16 | |
| 17 | #endregion |
| 18 | |
| 19 | #region KeyFocus |
| 20 | |
| 21 | [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] |
| 22 | [return: MarshalAs(UnmanagedType.U1)] |
| 23 | private static extern bool ExportInputManager_GetKeyFocus(); |
| 24 | |
| 25 | public bool KeyFocus |
| 26 | { |
| 27 | get { return ExportInputManager_GetKeyFocus(); } |
| 28 | } |
| 29 | |
| 30 | #endregion |
| 31 | |
| 32 | #region KeyFocusWidget |
| 33 | |
| 34 | [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] |
| 35 | private static extern IntPtr ExportInputManager_GetKeyFocusWidget(); |
| 36 | [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] |
| 37 | private static extern void ExportInputManager_SetKeyFocusWidget(IntPtr _widget); |
| 38 | |
| 39 | public Widget KeyFocusWidget |
| 40 | { |
| 41 | get { return (Widget)BaseWidget.GetByNative(ExportInputManager_GetKeyFocusWidget()); } |
| 42 | set { ExportInputManager_SetKeyFocusWidget(value == null ? IntPtr.Zero : value.Native); } |
| 43 | } |
| 44 | |
| 45 | #endregion |
| 46 | |
| 47 | #region MouseFocus |
| 48 | |
| 49 | [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] |
| 50 | [return: MarshalAs(UnmanagedType.U1)] |
| 51 | private static extern bool ExportInputManager_GetMouseFocus(); |
| 52 | |
| 53 | public bool MouseFocus |
| 54 | { |
| 55 | get { return ExportInputManager_GetMouseFocus(); } |
| 56 | } |
| 57 | |
| 58 | #endregion |
| 59 | |
| 60 | #region MouseFocusWidget |
| 61 | |
| 62 | [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] |
| 63 | private static extern IntPtr ExportInputManager_GetMouseFocusWidget(); |
no test coverage detected