private static XkbKeyboardDescription CreateMockXkbKeyboard(string name, string layout, string locale,
			string layoutName, int group, XkbKeyboardAdaptor adapter)
        {
            var keyboard = new XkbKeyboardDescription(name, layout, locale,
                new InputLanguageWrapper(locale, IntPtr.Zero, layoutName), adapter, group);
            KeyboardController.Manager.RegisterKeyboard(keyboard);
            return keyboard;
        }
        public void ActivateKeyboard_SecondTime_NotCrash()
        {
            XklEngineResponder.SetGroupNames = new string[] { KeyboardUSA };

            var adaptor = new XkbKeyboardAdaptor(new XklEngineResponder());
            KeyboardController.Manager.SetKeyboardAdaptors(new [] { adaptor });
            var keyboards = Keyboard.Controller.AllAvailableKeyboards;
            adaptor.ActivateKeyboard(keyboards.First());

            adaptor = new XkbKeyboardAdaptor(new XklEngineResponder());
            KeyboardController.Manager.SetKeyboardAdaptors(new [] { adaptor });
            keyboards = Keyboard.Controller.AllAvailableKeyboards;
            adaptor.ActivateKeyboard(keyboards.First());
        }