diff options
Diffstat (limited to 'imtable.h')
-rw-r--r-- | imtable.h | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -1,11 +1,36 @@ //Generic Input Method Used in Testing, see boshiamy.h for full implementation +//number of entries + + + +//indicators for turning the im on and off +#define IM_ON_INDICATOR "開" +//string length in bytes +#define IM_ON_INDICATOR_LEN 3 +#define IM_OFF_INDICATOR "關" +#define IM_OFF_INDICATOR_LEN 3 +//width of the indicator as displayed on the terminal +#define IM_INDICATOR_WIDTH 2 + + +//length of input method table #define IM_TABLE_LEN 5 +//length of entry fields in bytes #define IM_TABLE_ENTRY_LEN 8 -//assumes this is sorted +//maximum entry width as displayed on terminal +#define IM_TABLE_ENTRY_WIDTH 2 + +//the first field is the sequence of ascii characters (including space and +//numbers) used to get to a character, second field is the character itself, +//last firled is unused. + +//NOTE: This list HAS TO BE SORTED, as a binary search is used on it + +//For example, pressing "a<space>" will yield 對 char im_table[][3][IM_TABLE_ENTRY_LEN] = { {"a ", "對", "100"}, {"aa ", "對", "100"}, {"b ", "八", "100"}, {"ba ", "不", "100"}, - {"1", "一", "100"}, + {"e1", "一", "100"}, }; |