From 0cb23fc315bfd5e65b5f5bc7c9e07b2d35698018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Sat, 6 Sep 2025 14:25:36 -0700 Subject: Made the imtable use all the latest features --- imtable.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/imtable.h b/imtable.h index f045cc0..f6efe8c 100644 --- a/imtable.h +++ b/imtable.h @@ -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" will yield 對 char im_table[][3][IM_TABLE_ENTRY_LEN] = { {"a ", "對", "100"}, {"aa ", "對", "100"}, {"b ", "八", "100"}, {"ba ", "不", "100"}, - {"1", "一", "100"}, + {"e1", "一", "100"}, }; -- cgit v1.1