From e1075f9279d7e905741a7e8e9af1b6054cb14202 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 31 Aug 2009 06:34:16 +0000 Subject: [PATCH] *** empty log message *** --- FORMATS/IM-tut.txt | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/FORMATS/IM-tut.txt b/FORMATS/IM-tut.txt index 793e727..51bd7af 100644 --- a/FORMATS/IM-tut.txt +++ b/FORMATS/IM-tut.txt @@ -50,12 +50,12 @@ For instance @verbatim (n i) @endverbatim -represents a key sequence of \ and \. +represents a key sequence of <> and <>. If all SYMBOLIC-KEYs are ASCII characters, you can use the short form @verbatim "ni" @endverbatim -instead. Consult #mdbIM for Non-ASCII characters. +instead. Consult @ref mdbIM for Non-ASCII characters. Both MAP-ACTION and BRANCH-ACTION are a sequence of actions of this format: @verbatim @@ -104,8 +104,8 @@ Here is a simple example of an input method that works as CapsLock. When this input method is activated, it is in the initial condition of the first state (in this case, the only state [[init]]). In the initial condition, no key is being processed and no action is -suspended. When the input method receives a key event \, it -searches branches in the current state for a rule that matches \ +suspended. When the input method receives a key event <>, it +searches branches in the current state for a rule that matches <> and finds one in the map [[toupper]]. Then it executes MAP-ACTIONs (in this case, just inserting "A" in the preedit buffer). After all MAP-ACTIONs have been executed, the input method shifts to the initial @@ -122,7 +122,7 @@ that event is unhandled and given back to the application program. Turkish users may want to extend the above example for "Ä°" (U+0130: LATIN CAPITAL LETTER I WITH DOT ABOVE). It seems that assigning the -key sequence \ \ for that character is convenient. So, he +key sequence <> <> for that character is convenient. So, he will add this rule in [[toupper]]. @verbatim @@ -135,30 +135,30 @@ However, we already have the following rule: ("i" "I") @endverbatim -What will happen when a key event \ is sent to the input method? +What will happen when a key event <> is sent to the input method? -No problem. When the input method receives \, it inserts "I" in the +No problem. When the input method receives <>, it inserts "I" in the preedit buffer. It knows that there is another rule that may -match the additional key event \. So, after inserting "I", it +match the additional key event <>. So, after inserting "I", it suspends the normal behavior of shifting to the initial condition, and waits for another key. Thus, the user sees "I" with underline, which indicates it is not yet committed. -When the input method receives the next \, it cancels the effects +When the input method receives the next <>, it cancels the effects done by the rule for the previous "i" (in this case, the preedit buffer is cleared), and executes MAP-ACTIONs of the rule for "ii". So, "Ä°" is inserted in the preedit buffer. This time, as there are no other rules that match with an additional key, it shifts to the initial condition of the current state, which leads to commit "Ä°". -Then, what will happen when the next key event is \ instead of \? +Then, what will happen when the next key event is <> instead of <>? No problem, either. -The input method knows that there are no rules that match the \ \ key -sequence. So, when it receives the next \, it executes the +The input method knows that there are no rules that match the <> <> key +sequence. So, when it receives the next <>, it executes the suspended behavior (i.e. shifting to the initial condition), which -leads to commit "I". Then the input method tries to handle \ in +leads to commit "I". Then the input method tries to handle <> in the current state, which leads to commit "A". So far, we have explained MAP-ACTION, but not @@ -230,17 +230,17 @@ method before explaining how it works. (nil (shift init)))) @endverbatim -Let's see what happens when the user types the key sequence \ \ \< \>. -Upon \, "A" is inserted into the buffer and the state shifts to [[non-upcase]]. -So, the next \ is handled in the [[non-upcase]] state. +Let's see what happens when the user types the key sequence <> <> << >>. +Upon <>, "A" is inserted into the buffer and the state shifts to [[non-upcase]]. +So, the next <> is handled in the [[non-upcase]] state. As it matches a rule in the map [[lower]], "b" is inserted in the preedit buffer and characters in the buffer ("Ab") are committed explicitly by the "commit" command in BRANCH-ACTION. After -that, the input method is still in the [[non-upcase]] state. So the next \< \> +that, the input method is still in the [[non-upcase]] state. So the next << >> is also handled in [[non-upcase]]. For this time, no rule in this state matches it. Thus the branch [[(nil (shift init))]] is selected and the -state is shifted to [[init]]. Please note that \< /> is not yet +state is shifted to [[init]]. Please note that << >> is not yet handled because the map [[nil]] does not consume any key event. So, the input method tries to handle it in the [[init]] state. Again no rule matches it. Therefore, that event is given back to the application @@ -249,7 +249,7 @@ program, which usually inserts a space for that. When you type "a quick blown fox" with this input method, you get "A Quick Blown Fox". OK, you find a typo in "blown", which should be "brown". To correct it, you probably move the cursor after "l" and type -\> and \>. However, if the current input method is still +<> and <>. However, if the current input method is still active, a capital "R" is inserted. It is not a sophisticated behavior. @@ -519,7 +519,7 @@ BRANCH-ACTIONs, the character is commited. This new input method always checks the character before the current position, so "A Quick Blown Fox" will be successfully fixed to "A -Quick Brown Fox" by the key sequence \> \>. +Quick Brown Fox" by the key sequence <> <>. */ -- 1.7.10.4