public Cursor(SystemCursor id) : this() { var cursor = ErrorIfInvalid(SDL_CreateSystemCursor(id)); SetHandle(cursor.handle); cursor.SetHandle(IntPtr.Zero); }
private void OSXCapture_CaptureModeChanged(object sender, CaptureModeChangedEventArgs e) { switch (e.NewValue) { case Core.CaptureMode.Unknown: if (e.OldValue == Core.CaptureMode.Window) { var mw = new MessageWindow(Config.AppName, "Comming soon!"); mw.Show(); mw.Activate(); } SystemCursor.Show(); HideDragLayer(); ClearLayer(); break; case Core.CaptureMode.Drag: case Core.CaptureMode.Window: SystemCursor.Hide(); UpdateLayout(MousePosition, MousePosition); break; case Core.CaptureMode.FullScreen: break; } }
/// <summary> /// Replaces the specified system cursor with the given cursor. The cursor will /// be destroyed and as such must not be loaded from a resource. Use CopyCursor /// on cursors loaded from resources before calling this method. /// </summary> public static void SetSystemCursor(CursorHandle cursor, SystemCursor id) { if (!Imports.SetSystemCursor(cursor, id)) { throw Error.GetExceptionForLastError(); } }
private static void ForceClose() { MouseHook.UnHook(); Keyboard.Hook.UnHook(); SystemCursor.Show(); Application.ExitThread(); }
/// <summary> /// Replaces the specified system cursor with the given cursor. The cursor will /// be destroyed and as such must not be loaded from a resource. Use CopyCursor /// on cursors loaded from resources before calling this method. /// </summary> public static void SetSystemCursor(CursorHandle cursor, SystemCursor id) { if (!Imports.SetSystemCursor(cursor, id)) { throw Errors.GetIoExceptionForLastError(); } // SetSystemCursor destroys passed in cursors cursor.SetHandleAsInvalid(); }
public WindowsCursor(SystemCursor systemCursor) { switch (systemCursor) { default: case SystemCursor.Arrow: Handle = IntPtr.Zero; break; case SystemCursor.IBeam: Handle = Win32.LoadCursor(IntPtr.Zero, (int)Win32.CursorName.IBeam); break; } }
public static void Close() { if (MouseHook != null) { MouseHook.UnHook(); Notify.Visible = false; SystemCursor.Show(); MouseHook = null; Notify = null; } Application.Exit(); }
private static void Initialize() { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += Application_ThreadException; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Dispatcher.Init(); HotkeyManager.Init(); SystemCursor.Show(); LoadAssembly("SharpDX.dll"); LoadAssembly("SharpDX.Direct3D11.dll"); LoadAssembly("SharpDX.DXGI.dll"); ShutterPlayer = new SoundPlayer(Properties.Resources.shutter); OSXCapture = new OSXCapture(); foreach (var engine in OSXCapture.CaptureEngines) { engine.BeginCapture += ScreenCapture_BeginCapture; } MouseHook = new MouseHook(); MouseHook.Hook(); MouseHook.Filters.Add(OSXCapture); #if DEBUG HotkeyManager.Register("Force_Close", new Hotkey() { ModifierKey = VKeys.Alt, SubKeys = new[] { VKeys.Escape }, Action = new HotKeyEvent((s, e) => { Program.Close(); (e as HotkeyEventArgs).Handled = true; }) }); #endif }
public DesktopWindow(string title, uint width, uint height) { const int centered = Sdl2Native.SDL_WINDOWPOS_CENTERED; Sdl2Native.SDL_Init(SDLInitFlags.Video | SDLInitFlags.GameController); _window = new Sdl2Window(title, centered, centered, (int)width, (int)height, SDL_WindowFlags.OpenGL, threadedProcessing: false ); SwapchainSource = VeldridStartup.GetSwapchainSource(_window); _arrow = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Arrow); _hand = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Hand); _wait = Sdl2Native.SDL_CreateSystemCursor(SDL_SystemCursor.Wait); _cursor = SystemCursor.Arrow; }
public SystemCursorMode(SystemCursor cursor) { _cursor = cursor; }
/// <summary> /// Creates a system cursor. /// </summary> public Cursor(string id, SystemCursor cursor) : this(id) { IsSystemCursor = true; SystemCursor = cursor; }
public static extern Cursor SDL_CreateSystemCursor(SystemCursor id);
/// <summary> /// Replaces the specified system cursor with the given cursor. The cursor will /// be destroyed and as such must not be loaded from a resource. Use CopyCursor /// on cursors loaded from resources before calling this method. /// </summary> public static void SetSystemCursor(CursorHandle cursor, SystemCursor id) => Error.ThrowLastErrorIfFalse(Imports.SetSystemCursor(cursor, id));
public static extern IntPtr LoadCursor(IntPtr hInstcance, SystemCursor hcur);
void SetCursor(CustomCursor[] customs, SystemCursor system) { _customs = customs; _system = system; }
/// <summary> /// Constructs a cursor from a system-defined icon. /// </summary> /// <param name="cursor"> /// The cursor to construct /// </param> public SDLCursor(SystemCursor cursor) { sdlCursorPtr = SDL.SDL_CreateSystemCursor((SDL.SDL_SystemCursor)cursor); }
public static extern bool SetSystemCursor(IntPtr cursor, SystemCursor id);
public static IntPtr LoadCursor(IntPtr hInstcance, SystemCursor hcur) { NotImplemented(MethodBase.GetCurrentMethod()); return(IntPtr.Zero); }
private static extern IntPtr SDL_CreateSystemCursor(SystemCursor id);
extern public static IntPtr CreateSystemCursor(SystemCursor id);
internal override void Reset() { _customs = new CustomCursor[0]; _system = Default; }
public static IntPtr CreateSystemCursor(SystemCursor id) { return(GetError(SDL_CreateSystemCursor(id))); }
public static extern IntPtr CreateSystemCursor(SystemCursor id);
/// <summary> /// Creates a system cursor. /// </summary> public Cursor(string id, SystemCursor cursor) : this(id, "") { _isSystemCursor = true; _systemCursor = cursor; }
public override Cursor CreateCursor(SystemCursor systemCursor) { return(_fakeCursor); }
public static IntPtr LoadCursor(IntPtr hInstance, SystemCursor cursor) { return(LoadCursor(hInstance, new IntPtr((int)cursor))); }
public static extern bool SetSystemCursor( CursorHandle hcur, SystemCursor id);