Пример #1
0
        private void Init()
        {
            using (Settings xmlreader = new MPSettings())
            {
                controlEnabled = xmlreader.GetValueAsBool("remote", "AppCommand", false);
                controlEnabledGlobally = xmlreader.GetValueAsBool("remote", "AppCommandBackground", false);
                logVerbose = xmlreader.GetValueAsBool("remote", "AppCommandVerbose", false);
            }

            if (controlEnabled)
            {
                _inputHandler = new InputHandler("AppCommand");
                if (!_inputHandler.IsLoaded)
                {
                    controlEnabled = false;
                    Log.Info("AppCommand: Error loading default mapping file - please reinstall MediaPortal");
                }
            }

            if (controlEnabledGlobally)
            {
                _keyboardHook = new KeyboardHook();
                _keyboardHook.KeyDown += new KeyEventHandler(OnKeyDown);
                _keyboardHook.IsEnabled = true;
            }
        }
Пример #2
0
 private void InstallKeyboardHook()
 {
   Log.Write("MPTray: InstallKeyboardHook");
   _keyboardHook = new KeyboardHook();
   _keyboardHook.KeyDown += OnKeyDown;
   _keyboardHook.KeyUp += OnKeyUp;
   _keyboardHook.IsEnabled = true;
 }