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;
        }
示例#2
0
        internal void AddKeyboardForLayout(XklConfigRegistry.LayoutDescription layout, int iGroup, IKeyboardAdaptor engine)
        {
            var         description = GetDescription(layout);
            CultureInfo culture     = null;

            try
            {
                culture = new CultureInfo(layout.LocaleId);
            }
            catch (ArgumentException)
            {
                // This can happen if the locale is not supported.
                // TODO: fix mono's list of supported locales. Doesn't support e.g. de-BE.
                // See mono/tools/locale-builder.
            }
            var inputLanguage = new InputLanguageWrapper(culture, IntPtr.Zero, layout.Language);
            var keyboard      = new XkbKeyboardDescription(description, layout.LayoutId, layout.LocaleId,
                                                           inputLanguage, engine, iGroup);

            KeyboardController.Manager.RegisterKeyboard(keyboard);
        }
 internal XkbKeyboardDescription(XkbKeyboardDescription other) : base(other)
 {
     GroupIndex = other.GroupIndex;
 }
 internal XkbKeyboardDescription(XkbKeyboardDescription other)
     : base(other)
 {
     GroupIndex = other.GroupIndex;
 }
		internal void AddKeyboardForLayout(XklConfigRegistry.LayoutDescription layout, uint iGroup,
			IKeyboardSwitchingAdaptor engine)
		{
			var description = GetDescription(layout);
			CultureInfo culture = null;
			try
			{
				culture = new CultureInfo(layout.LocaleId);
			}
			catch (ArgumentException)
			{
				// This can happen if the locale is not supported.
				// TODO: fix mono's list of supported locales. Doesn't support e.g. de-BE.
				// See mono/tools/locale-builder.
			}
			var inputLanguage = new InputLanguageWrapper(culture, IntPtr.Zero, layout.Language);
			var keyboard = new XkbKeyboardDescription(description, layout.LayoutId, layout.LocaleId,
				inputLanguage, engine, (int)iGroup);
			KeyboardController.Manager.RegisterKeyboard(keyboard);
		}