Artemis.Managers.DeviceManager.ReleaseActiveKeyboard C# (CSharp) Method

ReleaseActiveKeyboard() public method

Releases the active keyboard
public ReleaseActiveKeyboard ( bool save = false ) : void
save bool Whether to save the LastKeyboard (making it null)
return void
        public void ReleaseActiveKeyboard(bool save = false)
        {
            lock (this)
            {
                if (ActiveKeyboard == null)
                    return;

                // Store the old keyboard so it can be used in the event we're raising later
                var oldKeyboard = ActiveKeyboard;

                var releaseName = ActiveKeyboard.Name;
                ActiveKeyboard.Disable();
                ActiveKeyboard = null;

                if (save)
                {
                    _generalSettings.LastKeyboard = null;
                    _generalSettings.Save();
                }

                RaiseKeyboardChangedEvent(new KeyboardChangedEventArgs(oldKeyboard, null));
                _logger.Debug("Released keyboard: {0}", releaseName);
            }
        }

Usage Example

Exemplo n.º 1
0
        public void Stop()
        {
            if (!Running)
            {
                return;
            }

            _logger.Debug("Stopping LoopManager");
            Running = false;

            _deviceManager.ReleaseActiveKeyboard();
        }
All Usage Examples Of Artemis.Managers.DeviceManager::ReleaseActiveKeyboard