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 to work correctly.) I…

1

Oops!

If you’ve tried to use the modified version of Scintilla that I described in my MSDN article, you will find that the zipped sources don’t actually have the changes that I made.  That was my fault; when I was packaging the sources, I had two versions of ScintillaWin.cxx around, and I picked the newer one,…

0

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.

0

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 a global compartment (that you…

0

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, but they aren’t explicitly stated anywhere (that I know of).   I’ve…

0

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 virtual key codes to character codes. It…

0

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 | IS_ENUMSTRING – meaning…

0

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 another control.  An…

0

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, and,…

0

Steam Trek: The Moving Picture

I don’t have anything better to blog about right now (I’m in the middle of reviews and designs), so I thought I would share a bit of whimsy – notably, this steampunk version of Star Trek. If you’re familiar with A Trip to the Moon, you will find this deeply funny.  Hat tip to BT. (If…

0