public IKeyInputController CreateKeyboardController(IKeyboardPlugin plugin, ISession session) { var controller = new KeyInputController(plugin, session); controller.Initialize(); return(controller); }
public KeyInputController(IKeyboardPlugin plugin, ISession session) { _plugin = plugin; _context = new KeyInputContext(UIAssistantAPI.Instance.KeyboardAPI.CreateHookHandlers(), UIAssistantAPI.Instance.KeyboardAPI.CreateKeybindManager()); _session = session; }
/// <summary> /// Loads the plugins /// </summary> public void LoadPlugins() { this.UnLinkPluginEvents(); this.SelectedGraphicsPlugin = this.PluginService.GetPluginByNameSpace <IGraphicsPlugin>(Settings.Default.SelectedGraphicsPlugin); this.SelectedSoundPlugin = this.PluginService.GetPluginByNameSpace <ISoundPlugin>(Settings.Default.SelectedSoundPlugin); this.SelectedKeyboardPlugin = this.PluginService.GetPluginByNameSpace <IKeyboardPlugin>(Settings.Default.SelectedKeyboardPlugin); this.LinkPluginEvents(); }
/// <summary> /// Loads the plugins based on the configuration of the system /// </summary> public void LoadPlugins() { // In case there was a previous load, we unlink the already loaded plugins this.UnLinkPluginEvents(); var graphicsNameSpaceSavedPlugin = this.EngineMediator.GetSavedPluginNameSpaceOfType <IGraphicsPlugin>(); this.SelectedGraphicsPlugin = !string.IsNullOrEmpty(graphicsNameSpaceSavedPlugin) ? this.PluginService.GetPluginByNameSpace <IGraphicsPlugin>(graphicsNameSpaceSavedPlugin) : null; var soundNameSpaceSavedPlugin = this.EngineMediator.GetSavedPluginNameSpaceOfType <ISoundPlugin>(); this.SelectedSoundPlugin = !string.IsNullOrEmpty(soundNameSpaceSavedPlugin) ? this.PluginService.GetPluginByNameSpace <ISoundPlugin>(soundNameSpaceSavedPlugin) : null; var keyboardNameSpaceSavedPlugin = this.EngineMediator.GetSavedPluginNameSpaceOfType <IKeyboardPlugin>(); this.SelectedKeyboardPlugin = !string.IsNullOrEmpty(keyboardNameSpaceSavedPlugin) ? this.PluginService.GetPluginByNameSpace <IKeyboardPlugin>(keyboardNameSpaceSavedPlugin) : null; // Once the plugins are loaded we link its events this.LinkPluginEvents(); }
public static bool TryGetKeyboard(this PanaceaServices core, out IKeyboardPlugin keyboard) { keyboard = core.PluginLoader.GetPlugins <IKeyboardPlugin>().FirstOrDefault(); return(keyboard != null); }