Commit Graph

7 Commits

Author SHA1 Message Date
zonble 2ebc789030 Implements the associated phrases function.
Since we use states manage the input flow in McBopomofo, implementing this function becomes easy. What I did is to create a new state, Associated Phrases state, and let the key handler to emit such a state just after emitting a Committing state.

When the input method controller is under Associated Phrase state, it shows the candidate window with a tooltip, and only accept candidate keys with the shift key. The key handler uses the characters without modifiers in an NSEvent object to find if there is any matching candidate label, so I added a new member "inputTextIgnoringModifiers" to KeyHandlerInput.

I use KeyValueBlobReader to read the associated phrases. I use the cin file from OpenVanilla project but removed the head and tail of the file to pass KeyValueBlobReader's validation.
2022-01-31 13:23:49 +08:00
zonble c3d953c618 Converts input mode into a typed enum. 2022-01-30 08:06:22 +08:00
zonble 4c358c1c1d Converts InputMethodController to Swift. 2022-01-30 08:06:22 +08:00
zonble 485925634a Adds unit tests for the key handler. 2022-01-28 20:43:43 +08:00
zonble 9612aa6ba0 Code clean-up. 2022-01-28 16:51:25 +08:00
zonble b13da10ec0 Code clean-up. 2022-01-28 16:16:52 +08:00
zonble 0bc9468ba2 Splits Input Method controller into two classes. 2022-01-28 15:02:00 +08:00