// Enables keys interception with selected |interception_method|. Backs off to WinAPI if failed loading interception driver. public bool Reset() { lock (Helpers.locker) { Stop(); if (Options.Instance.accessibility_mode) { mouse_controller = new AccessibilityMouseController(eye_tracking_mouse); } else { mouse_controller = new DefaultMouseController(eye_tracking_mouse); } if (Options.Instance.key_bindings.interception_method == KeyBindings.InterceptionMethod.OblitaDriver) { input_provider = new OblitaInterceptionInputProvider(mouse_controller); input_provider.Load(); if (input_provider.IsLoaded) { return(true); } } input_provider = new WinApiInputProvider(mouse_controller); input_provider.Load(); return(Options.Instance.key_bindings.interception_method == KeyBindings.InterceptionMethod.WinApi); } }
// Enables keys interception with selected |interception_method|. Backs off to WinAPI if failed loading interception driver. public bool UpdateInterceptionMethod() { lock (Helpers.locker) { Stop(); if (Options.Instance.key_bindings.interception_method == KeyBindings.InterceptionMethod.OblitaDriver) { input_provider = new OblitaInterceptionInputProvider(this); input_provider.Load(); if (input_provider.IsLoaded) { return(true); } } input_provider = new WinApiInputProvider(this); input_provider.Load(); return(Options.Instance.key_bindings.interception_method == KeyBindings.InterceptionMethod.WinApi); } }