summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-06 14:25:36 -0700
committerHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-06 14:25:36 -0700
commit0cb23fc315bfd5e65b5f5bc7c9e07b2d35698018 (patch)
treef2c5efa56cb5a46dfea40e3778c83c93133a7051
parentcb9816ec8911ba993bc7837b5c4264a4b4e4bdc1 (diff)
Made the imtable use all the latest features
-rw-r--r--imtable.h29
1 files 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<space>" will yield 對
char im_table[][3][IM_TABLE_ENTRY_LEN] = {
{"a ", "對", "100"},
{"aa ", "對", "100"},
{"b ", "八", "100"},
{"ba ", "不", "100"},
- {"1", "一", "100"},
+ {"e1", "一", "100"},
};