Commit Graph

137 Commits

Author SHA1 Message Date
zonble f7e927d67d Starts to use Swift candidate UI.
There are bugs still.
2022-01-11 00:30:02 +08:00
zonble a97cc5ca6c Converts VerticalCandidateController to Swift. 2022-01-11 00:03:32 +08:00
zonble 75a0f68a9c Fixes the bug that I forgot to create the user phrases folder.
There was a legacy user override model which creates a folder and a
plist file. If a user uses McBopomofo for years, the folder would
exist. However, when the old override model was removed, I forgot
to create the folder for the new user phrase file.

The bug would let the users with new installation of McBopomofo unable
to add user phrases.
2022-01-10 21:59:18 +08:00
zonble 0af238ef79 Cleans-up unused logs. 2022-01-09 08:38:32 -08:00
zonble a5247d958c Makes it able to reload user phrases. 2022-01-09 08:38:32 -08:00
zonble e909dc20b5 Uses user phrases in the block builder. 2022-01-09 08:38:32 -08:00
zonble 6f761ecbcd Implements adding phrase from shift and arrow keys. 2022-01-09 08:38:32 -08:00
zonble 358462dff1 [WIP] Starts to work on the user phrases. 2022-01-09 08:38:32 -08:00
ovadmin aeb774a8ed 小幅重構重複的程式碼 2022-01-06 18:28:37 -08:00
ovadmin 2e8e78971c 傳統注音不要記住用戶選字 2022-01-06 18:28:37 -08:00
ovadmin eef6f8c0ce 加大用戶選字詞模型的容量跟半衰期 2022-01-06 18:28:37 -08:00
ovadmin 3e0e859feb 將用戶選字記憶機制整合入 InputMethodController 2022-01-06 18:28:37 -08:00
ovadmin 3760d24350 移除早期的候選歷史記憶機制
這個機制從未正式發布,設計本身也有很多缺陷,因此決定移除。
2022-01-06 18:28:29 -08:00
zonble 23100153cc Adds an option to clear entire input buffer by ESC key.
This fixes #146.
2022-01-02 22:09:23 +08:00
Lukhnos Liu 5ff3efb385 Revert "Stop using IMK's showPreferences:"
This reverts commit 69e463958e.
2021-11-24 21:16:20 -08:00
Lukhnos Liu 69e463958e Stop using IMK's showPreferences:
This turns out to be unreliable on macOS 12.
2021-11-23 19:04:42 -08:00
zonble 164705e6f3 Allows users to use left and right key to go to another candidate page in the vertical candidates list.
This fixes #61.
2021-11-20 22:43:23 -08:00
zonble e27f5babe1 Allows auto-commiting the first candidate when users input a punctuation in plan BPMF mode. 2021-11-20 22:43:23 -08:00
zonble 385638c3b9 Allows commit the first canidate while typing a punctuation in plain BPMF mode. 2021-11-20 22:43:23 -08:00
zonble c17d991718 Also applies Chinese conversion on popped text.
Fixes issue #172.
2021-11-20 18:14:08 -08:00
zonble 723a8402ab Fixes typos. 2021-11-11 00:14:49 +08:00
zonble f6c36fe325 Bridges SwiftyOpenCC to create a simple Chinese convertion function. 2021-03-01 22:43:02 +08:00
zonble 4e27b5ecfa Adopts modern Objective-C syntax. 2021-02-28 22:45:36 +08:00
zonble 0f05e245a5 Coverts to Objective-C ARC. 2021-02-28 21:30:10 +08:00
Lukhnos Liu 81748ae7fe Enable explicit update check in Release builds 2020-10-19 14:51:05 -07:00
Lukhnos Liu 4c8270c42f Cancel candidate by Bksp or Del when Plain Bopomofo
Fixes #152
2020-10-17 06:19:47 -07:00
Lukhnos Liu 71b97f82b3 Simplify candidate fixing by moving code to Grid 2020-10-09 22:16:06 -07:00
Lukhnos Liu 7978a9efba Update composing buffer after candidate keys (#145)
Recent versions of Chrome started to rely on whether composing buffer
gets updated after an arrow key event to determine whether to dismiss
(force commit) the composing buffer and handle the arrow key event for
the omnibox URL suggestions.
2019-06-18 22:14:05 -07:00
Lukhnos Liu ea865c6a24 Fix a static analyzer warning 2018-12-01 06:58:42 -08:00
Lukhnos Liu 8058f37fff Modernize project and bump min version to 10.10
32-bit architecture support is removed as a result.
2018-11-24 21:47:15 -08:00
ovadmin e065d6fa17 Fix incorrect unprintable ASCII handling (#139)
When Caps Lock is on and when the character code is not printable, we
should simply reject handling such character instead of absorbing it and
inserting the character to the client buffer--not all apps handle those
insertions.
2018-07-07 13:25:10 -07:00
ovadmin 9be64e0a48 修正在 macOS 10.13 beta 上無法叫出偏好設定的問題
修正根據請參考以下連結:
3241c7f688
2017-09-04 21:21:09 -07:00
Lukhnos Liu 5f19be59b4 Override keyboard layout correctly. Fixes #86.
Using numerous NSLog's led to the discovery that when McBopofomo lost
function (as described in #86), -setValue:forTag:client: was often called
not just on the context of the foreground app, but also on the contexts
of the background apps. This led to the theory that calling keyboard
layout override in that method (not a documented way of doing things
anyways) might corrupt the input method context. That we swapped out
language model and the builder when the method got called didn't help.

In this commit, we put back the keyboard layout override code to where
it belongs -- in -activateServer: -- and we now only swap the language
model and re-create the builder if the input method really changes (e.g.
from Bopomofo to Plain Bopomofo, or vice versa).

Similar defensive coding is also used in the function key handler in the
-handleEvent:client: method.
2014-05-18 20:41:53 -07:00
Lukhnos Liu b56508c55c Add a debug menu item for checking updates 2014-05-16 21:16:39 -07:00
leafy7382 0240445af5 NSPropertyListFormat does not need an assignment before use, remove rvalue. 2013-02-17 01:10:43 +08:00
Lukhnos Liu 92e2d41eba Clean up reading buf at deactivation (fixes #72) 2012-12-13 19:50:04 -08:00
Lukhnos Liu 9448c1af48 Fix Plain Bopomofo regression (#71)
This is caused by a missing method. Our implementation for
-[NSObject(IMKServerInput) inputText🔑modifiers:client:] was changed
to handleEvent: in 0.9.5.

Interestingly, calling -inputText🔑modifiers:client: somehow worked
when we linked against OS X 10.7 SDK (that was the SDK the 0.9.5
distribution used). This is no longer true with OS X 10.8 SDK.
2012-12-12 20:32:50 -08:00
Lukhnos Liu 95405cc72b Add UI support for IBM layout. Fixes #67.
Also change the layout constant from 4 to 5 since 4 is taken by Pinyin
layout.
2012-11-18 01:29:20 -08:00
Mengjuei beee34b96c Enable IBM Keyboard Layout, no update to xib yet 2012-11-13 00:40:26 -08:00
Lukhnos Liu 31a1a042fe Enlarge maximum candidate list text size. 2012-10-31 20:58:24 -07:00
Lukhnos Liu fadf8d431e Support Home/End/Del in input buffer, fixes #63.
Also fix two subtle issues:

1. Enter (not Return) key now works in candidate list
2. Cursor index should be compared against builder's length, *not*
   composed string's length, because the former is counted in
   code point but the latter in UTF-16 units. The composed string's
   length might therefore be longer if the string contains
   codepoints > U+FFFF, which would cause the cursor mechanism to
   be off.
2012-09-18 22:34:00 -07:00
Lukhnos Liu d4730068fa Handle Shift with function key layout overrides. 2012-09-12 22:13:53 -07:00
Lukhnos Liu a2ea20306c Support overriding function key keyboard layout. 2012-09-12 21:59:53 -07:00
Lukhnos Liu 08e7b14f3e Use the new LM class. 2012-09-10 22:56:21 -07:00
Lukhnos Liu bf50e4fa7e Fix a punctuation bug in Plain Bopomofo mode.
Bopomofo keyboard layout-specific punctuation keys were not handeled
properly. The candidates are now correctly collected.
2012-09-10 19:12:57 -07:00
Lukhnos Liu 71921b848a Use stable sort in the engine.
So that unigram nodes with the same log probability are sorted
according to the order in which they were added to the language
model.
2012-09-10 19:02:24 -07:00
Lukhnos Liu 7b4568e152 Load Plain Bopomofo data. 2012-09-10 19:02:21 -07:00
Lukhnos Liu 4cf94d5824 Support customizable alphanumeric keyboard layout.
Also make the default candidate font size bigger.
2012-09-09 12:36:04 -07:00
Lukhnos Liu 31f796f620 Implement the Plain Bopomofo mode. 2012-09-09 01:58:42 -07:00
Lukhnos Liu 37f31364b5 Project reorganization.
This commit:

* Creates a new top-level Xcode project file
* Renames remaining Lettuce (the original codename) uses to McBopomofo
* Renames English.lproj (the old style locale name) to en.lproj
2012-09-08 19:28:15 -07:00
Lukhnos D. Liu ddbd94bee4 Extract the candidate handler; handle subtleties of vertical text mode.
Now both Left and Right can be used as choose-candidate key. Also the
candidate window now doesn't obscure the vertical text being typed by
moving to the right to the vertical text. Because of this, Left key
feels strange. Adding Right key should give a better mental model.
2012-05-06 16:19:33 -07:00
Lukhnos D. Liu c48d478b4e Move enums to the top of the file. 2012-05-06 15:56:21 -07:00
Lukhnos D. Liu 6f2d617bcb Rename global variables. 2012-05-06 15:55:35 -07:00
Lukhnos D. Liu b369106719 Add Home/End key support in candidate panels. 2012-05-06 15:52:45 -07:00
Lukhnos D. Liu 1993942cd4 Refactor the code so that we use enums for key codes. 2012-05-06 15:52:45 -07:00
Lukhnos D. Liu f457b9d463 Fix a bug where the sink key handler missed a rejection condition. 2012-05-06 15:52:44 -07:00
Lukhnos D. Liu c52d68ed9e Correct the pref key names. 2012-04-08 15:16:04 -07:00
Lukhnos D. Liu 36b5a605dc Fix the bug that kCandidateTextFontName and kCandidateKeyLabelFontName shared the same value. 2012-04-08 15:12:26 -07:00
Lukhnos D. Liu 1693dc210e Add support for changing candidate keys and candidate panel fonts. 2012-04-08 15:08:53 -07:00
Lukhnos D. Liu c676d0d62c Handle the case where text client fails to handle char attr request. 2012-04-07 01:14:55 -07:00
Lukhnos D. Liu b0b5dd0233 Remove CJK font requirement as OS X 10.7 already handles fallback better. 2012-03-29 20:57:16 -07:00
Lukhnos D. Liu 815f885e29 Improve UI parameters. 2012-03-29 12:19:00 -07:00
Lukhnos D. Liu 9128ef95b2 Use Voltaire for candidate UI; use 10.7 base SDK. 2012-03-28 23:28:42 -07:00
Mengjuei b7a74e5593 revision.... 2012-03-01 23:47:06 -08:00
Mengjuei 0d8e1ae20f Tab conversion into 4 spaces 2012-02-26 20:53:51 -08:00
Mengjuei 373c631036 cosmetic change and change the location of the user dictionary 2012-02-26 16:24:09 -08:00
Mengjuei 82ead6dd72 [NSEvent modifierFlags] is out of place, eliminated. D.
+some phrases from the old notebook. M.
2012-02-25 01:19:44 -08:00
Mengjuei 61e2ed10d2 Solves Issue #44 2012-02-21 22:38:30 -08:00
Mengjuei e4715a3ed1 Avoid a bug that commits wrong stuff... 2011-12-02 01:50:57 -08:00
zonble c9d0378cd5 Cleans-up InputMethodController.mm. 2011-10-18 22:26:55 +08:00
Mengjuei 872b4ffc5d This solves https://github.com/mjhsieh/McBopomofo/issues/22 2011-10-17 01:09:28 -07:00
zonble 8991ddfa4e Fixes a regression caused by trying to fix the problem of th numeric pad. 2011-10-17 13:57:38 +08:00
zonble a9095f8dac Handles the number keyboard correctly. 2011-10-17 10:29:47 +08:00
zonble 3b411087c6 Sets the keyboard layout to com.apple.keylayout.US, besides using Hanyu Pinyin. 2011-10-17 00:37:59 +08:00
zonble 358ce9ef97 Fixes the problem that Hanyu Pinyin keyboard layout does not work. 2011-10-17 00:18:54 +08:00
zonble d8444413b5 Ignores the up and down key if the reading buffer is not empty. 2011-10-02 22:29:26 +08:00
zonble 4c1deb59e6 Adds an experimental symbol list. 2011-10-02 22:13:25 +08:00
zonble 1c304b51b8 Ignores keyboard events with numeric mask. 2011-10-02 21:21:18 +08:00
zonble cb0d7a82f5 Fixes an exception. 2011-10-02 14:20:35 +08:00
zonble 6a8eacd0bd Corrects key code setting. 2011-10-02 14:01:42 +08:00
zonble 406f483c83 Adds vertical text support. 2011-10-02 13:19:10 +08:00
zonble 4920bc4a18 Makes to use space key to choose candidates or not as an option. 2011-10-02 11:45:27 +08:00
Mengjuei Hsieh cf65a7d64b We are not ready for this yet. 2011-10-01 02:31:42 -07:00
Mengjuei Hsieh 6cd2bc0d67 capslock processing 2011-10-01 02:25:40 -07:00
Mengjuei Hsieh 1480073ac0 remove beep upon pressing ESC 2011-10-01 00:48:28 -07:00
Mengjuei Hsieh f54ed3ad9c Typos,
Spotted by friends.
2011-09-29 22:39:21 -07:00
Mengjuei Hsieh 5f976e4642 first commit 2011-09-01 23:56:26 -07:00