Exemplo n.º 1
0
        private static bool IsUsingInputProcessor()
        {
            if (!Platform.IsWindows)
            {
                // not yet implemented on Linux
                return(false);
            }

            TfInputProcessorProfilesClass inputProcessor;

            try
            {
                inputProcessor = new TfInputProcessorProfilesClass();
            }
            catch (InvalidCastException)
            {
                return(false);
            }

            var profileMgr = inputProcessor as ITfInputProcessorProfileMgr;

            if (profileMgr == null)
            {
                return(false);
            }

            var profile = profileMgr.GetActiveProfile(ref Guids.Consts.TfcatTipKeyboard);

            return(profile.ProfileType == TfProfileType.InputProcessor);
        }
Exemplo n.º 2
0
        public WinKeyboardAdaptor()
        {
            try
            {
                ProcessorProfiles = new TfInputProcessorProfilesClass();
            }
            catch (InvalidCastException)
            {
                ProcessorProfiles = null;
                return;
            }

            // ProfileMgr will be null on Windows XP - the interface got introduced in Vista
            ProfileMgr = ProcessorProfiles as ITfInputProcessorProfileMgr;

            m_tfLanguageProfileNotifySink = new TfLanguageProfileNotifySink(this);

            TfSource = ProcessorProfiles as ITfSource;
            if (TfSource != null)
            {
                m_profileNotifySinkCookie = TfSource.AdviseSink(Guids.ITfLanguageProfileNotifySink,
                                                                m_tfLanguageProfileNotifySink);
            }

            if (KeyboardController.EventProvider != null)
            {
                KeyboardController.EventProvider.ControlAdded    += OnControlRegistered;
                KeyboardController.EventProvider.ControlRemoving += OnControlRemoving;
            }
        }
Exemplo n.º 3
0
        public WinKeyboardAdaptor()
        {
            try
            {
                ProcessorProfiles = new TfInputProcessorProfilesClass();
            }
            catch (InvalidCastException)
            {
                ProcessorProfiles = null;
                return;
            }

            // ProfileMgr will be null on Windows XP - the interface got introduced in Vista
            ProfileMgr = ProcessorProfiles as ITfInputProcessorProfileMgr;
        }