TSF Aware

Dictation, Windows Speech Recognition, and Text Services Framework.

Browse by Tags

Tagged Content List
  • Blog Post: That pesky terminating composition

    If you’re developing a text service for Windows XP, you’ve likely found that your composition gets terminated unexpectedly whenever you have more than one character.  On English, you can avoid terminating your composition by making sure that every character in the composition has the GUID_PROP_COMPOSING...
  • Blog Post: Why you need to actually test instead of just looking at the source code

    In a previous post , I mentioned that you need to set the GUID_PROP_COMPOSING property across text in a composition, or else Windows XP will terminate the composition. That’s true. I then provided a code snippet to set that property. That snippet is wrong. It turns out that you can’t set the GUID_PROP_COMPOSING...
  • Blog Post: Where are the TSF Samples?

    Many people have emailed me asking about the TSF samples on MSDN.  They’re supposed to be on MSDN code gallery, although they don’t appear to be there. They are, however, part of the Windows SDK . After installation, you'll find them in %programfiles%\Microsoft SDKs\Windows\v6.1\Samples\winui\Input...
  • Blog Post: Categories

    In an earlier post on keyboards , I talked briefly about text service categories.  I'd like to talk more about categories. TSF will make sure that at most one text service in any category is enabled at any given time. So, for example, you can enable one text service with GUID_TFCAT_TIP_KEYBOARD...
  • Blog Post: Visual Studio 2008 issues

    If you're building a text service DLL, you almost certainly don't want to use Visual Studio 2008's compiler.  The problem is that Visual Studio 2008 uses a new C Runtime Library, and if you build your text service with Visual Studio, your text service likely won't load in all applications. ...
  • Blog Post: Things the Documentation left out, part N

    I recently had two people ask me the same question: "Why can't I insert more than one character into a composition on Notepad?" It's actually a bit more complicated than that, since this behavior only appears to happen on Windows XP with a US English text service. (Japanese text services appear...
  • Blog Post: ITfCompartmentEventSink::OnChange means what it says...

    I got caught by this recently. ITfCompartmentEventSink::OnChange means what it says. If you repeatedly store the same value into a global compartment, the event sinks will not fire. If you store a different value into the compartment, the event sinks fire just fine.
  • Blog Post: Compartment Values

    I've been working with compartments recently, and I've run across a few 'features' that tripped me up. I figure if I've run across them, others have too. Although MSDN says that you can put integers, BSTRs, and interface pointers into a compartment, you can not store interface pointers or strings into...
  • Blog Post: The usual path

    Text Services Framework assumes that your text service follows a particular processing path. If your text service doesn't conform to these assumptions, then your programming job will be more complicated. (Not impossible, just more complex.) The text service samples on MSDN also follow these assumptions...
  • Blog Post: What to do when you push a key

    I received an interesting email the other day asking about how to get the character code from the parameters passed to the ITfKeyEventSink::OnKeyDown method. The answer is that most keyboard related text services only work with a particular keyboard layout, and the text service manages the mapping from...
  • Blog Post: Input Scopes

    Another useful, but underutilized, group of functions in TSF are those relating to Input Scopes. Input Scopes allow an application to define the sorts of things that are expected in this document (edit control, etc.). For example, the Internet Explorer 7 address bar has an input scope of IS_URL | IS_DEFAULT...
  • Blog Post: Fun with Contexts

    One interface that I hadn't paid much attention to in TSF is ITfContextKeyEventSink . What does this let you do? Why, it lets you inspect keyboard input for a particular context (or document). This lets you do some really fun things, like redirect keyboard input from the current control and put it into...
  • Blog Post: Debugging a Text Service (and Visual Studio problems)

    I've received a few emails asking about debugging Text Services. I figured if two people actually went to the trouble of sending an email, that there's enough demand for a post. But first, a little diversion: It turns out that Visual Studio 2005 SP1 ships with an updated version of the C Runtime library...
  • Blog Post: What's a Keyboard?

    The Text Services Framework makes a number of assumptions when you register your text service as a keyboard text service (i.e., your text service calls RegisterCategory(<clsid of your text service>, GUID_TFCAT_TIP_KEYBOARD, <clsid of your text service). First, TSF assumes that exactly one...
  • Blog Post: Generating Candidates from a Text Service

    So how do you create the candidates from within the text service? Well, the first thing you need is the original input, and you need to know what text was created from the original input. Almost all text services (there might be a few that don't do this) place the created text in the document, and attach...
  • Blog Post: Generating Candidates from an Application

    Kirby left a comment to my post on candidates asking when a text service should create an ITfCandidateList. The answer is that when the text service wants to show candidates (via a preserved key or other mechanism), it should show its modal UI, and quite possibly may wish to push a new context so...
  • Blog Post: Transitory Extensions, or, how to get full text store support in TSF-unaware controls

    As I mentioned earlier , TSF provides very basic services in applications that are not TSF-aware. In particular, TSF provides only transitory documents and contexts that represent short-lived text compositions. In Windows Vista, TSF adds full text store support for some frequently-used text controls...
  • Blog Post: Text Service Variations

    Probably the most annoying thing about writing a text service is dealing with all the variations in text stores. They all have quirks that need to be worked around, and any significant change has to be tested against all the text stores to make sure that nothing broke. For example: Richedit * requires...
  • Blog Post: Rules of Text Services

    One of the harder parts of writing a text service is learning how to 'think' text services. Here are a couple of rules that I've developed (the hard way) after writing a text service: The first rule of writing a text service is: Keep the edit sessions fast, and keep the edit sessions small. When your...
  • Blog Post: Text services: Vista Extensions (UI Elements)

    The TSF tour ends here, with a brief discussion of UI Elements in Vista If your text service wishes to be available in full-screen applications like games, it must implement ITfUIElement , and call the ITfUIElementMgr whenever the text service wants to display some UI. (See the discussion of UILess...
  • Blog Post: Text Services: Vista Extensions

    In Windows Vista, TSF added the ability to run in locations where it had previously been disabled. For example, TSF is now available on secure desktops, in full screen (DirectX) applications, and in MTA threads. However, text services have to be aware of these new environments, and must tell TSF that...
  • Blog Post: Text Services: Candidates

    If your text service supports multiple interpretations of the same input, and you wish to allow users to correct the initial interpretation (for dictation, we call this 'correction'; IMEs tend to call it 'reconversion'), your text service will need to implement these interfaces. Your service will also...
  • Blog Post: Text Services: Function Providers

    TSF allows text services to offer optional extension points through the ITfFunctionProvider interface. Indirection through the function provider allows text services to minimize memory usage and startup time by instantiating services when requested, rather than when loaded. Interface ...
  • Blog Post: Text Services: Language Bar

    If your text service wishes to display some UI on the language bar, then your service will need to create objects that implement one (or more) of the following interfaces: Interface How Obtained ITfLangBarItem Pass this base interface to ITfLangBarItemMgr::AddItem...
  • Blog Post: Text Service: Display Attributes

    If your text service wishes to display text in different colors (e.g., displaying the current composition in red), then your text service needs to implement these interfaces: Interface How Obtained ITfDisplayAttributeProvider Obtained by QI from ITfTextInputProcessor...
Page 1 of 2 (27 items) 12