Behold the Table Driven Text Service, Part 3 (Where do keystrokes come in?)

by Michael S. Kaplan, published on 2008/01/24 10:16 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/01/24/7180212.aspx


Prior posts in the series:

Now I did not start this at the beginning, I kind of picked it up in the middle. Here is some info that is nice to know very near to the beginning, though....

Here are the pre-defined keystrokes and how they behave in the Candidate Window.

Note that they are Virtual Key (VK) based. I will get to the consequences of that in a moment.

While composing:

Virtual Key

Function

VK_LEFT

Move caret to left in composition char

If we have the Incremental Candidate List, then cancel composition.

VK_RIGHT

Move caret to right in composition char

If we have the Incremental Candidate List, then cancel composition

VK_RETURN

Finalize composition char

VK_ESCAPE

Cancel composition char

VK_BACK

Delete one composition char

VK_SPACE

Convert composition char

VK_UP

If we have the Incremental Candidate List, then move candidate selection to up

VK_DOWN

If we have the Incremental Candidate List, then move candidate selection to down

VK_PRIOR

If we have the Incremental Candidate List, then move candidate selection to prior

VK_NEXT

If we have the Incremental Candidate List, then move candidate selection to next

VK_HOME

If we have the Incremental Candidate List, then move candidate selection to home

VK_END

If we have the Incremental Candidate List, then move candidate selection to end

And then in the Candidate/Phrase Window:

Virtual Key

Function

VK_UP

Move candidate selection to up

VK_DOWN

Move candidate selection to down

VK_PRIOR

Move candidate selection to prior

VK_NEXT

Move candidate selection to next

VK_HOME

Move candidate selection to home

VK_END

Move candidate selection to end

VK_RETURN

Finalize candidate list

VK_ESCAPE

Cancel candidate list

VK_BACK

Cancel candidate list

VK_1 - VK_9

Select list item for corresponding number, one through nine

Now each text file has a section it in that is key to how every other character is handled. Here is what it looks like in our MSDN_TableTextService_Explicit.txt file:

[Keystroke.Composition]
VK_1,          0  = INPUT        // 1
VK_2,          0  = INPUT        // 2
VK_3,          0  = INPUT        // 3
VK_4,          0  = INPUT        // 4
VK_5,          0  = INPUT        // 5
VK_6,          0  = INPUT        // 6
VK_7,          0  = INPUT        // 7
VK_8,          0  = INPUT        // 8
VK_9,          0  = INPUT        // 9

Now as that list might or might not seem to indicate, all other keys just pass right through to the underlying keyboard that sits underneath the Tabld Driven TIP.

But adding a VK_* value to this list will cause keystrokes from that VK to be processed by the Table Driven Text Service -- and if those letters never appear in the [Text] section then those keystrokes will be eaten.

Now there are a few more advanced features, which I'll discuss soon.

And there is the interaction between the predefined keys and the ones you define in the file -- basically the rule is easy and simple for the DLL -- it always wins. Which means if you define something then it will alwys pay attention to you unless it has its own override (hih is why VK_1 - VK_9 have that weird behavior where as soon as you have a candidate list then if it is numbered then the candidate item selection takes prioirty over the actual input -- which leads to VERY confusing behavior.

I'll discuss this more soon, as well. :-)

At this point, you may be wondering about two more things -- the meaning of the INPUT keyword here, and the meaning of the number 0. The fact that every single text file on Vista includes these very same entries is just a special bonus to people trying to figure out the meaning without assistance or documentation....

If you are one of those people then you can take comfort in the fact that I was too, so I'll be getting to this very soon, in an upcoming blog in this series. :-)

Coming up soon, maybe next -- some really explicit information about the [TEXT] section, and more information on some of the configuration sections....

 

This post brought to you by(U+2462, aka CIRCLED DIGIT THREE)


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2008/10/21 Behond the Table Driven Text Service, Part 14 (Don't expect too much from numbers)

2008/07/25 Behold the Table Driven Text Service, Part 13 (Sinhalification proclamation!)

2008/06/30 Behold the Table Driven Text Service, Part 12 (The knights who say நீ, redux, #2)

2008/06/21 Back to Sri Lanka (conceptually)

2008/02/25 Behold the Table Driven Text Service, Part 11 (The knights who say நீ, redux, #1)

2008/02/15 Behold the Table Driven Text Service, Part 10 ("Even Jove nods," Atlas shrugged, "so we'll convert their old files, now.")

2008/02/12 Behold the Table Driven Text Service, Part 9 (Will you be content if I tell you how some content can be defined?)

2008/02/11 Behold the Table Driven Text Service, Part 8 (Configuration 'junk in the trunk', part 2)

2008/01/30 Behold the Table Driven Text Service, Part 7 (Configuration 'junk in the trunk', part 1)

2008/01/29 Behold the Table Driven Text Service, Part 6 (it is sufficient to be iconic, aka DaYi, DaYi Aynu!)

2008/01/28 Behold the Table Driven Text Service, Part 5 (All about the language, baby!)

2008/01/25 Behold the Table Driven Text Service, Part 4 (Specifying when to modify, if not how)

go to newer or older post, or back to index or month or day