²z gen_inp ҲժrP keystroke jMƵcC

gen_inp O .tab ɤŪJkAO cin2tab N .cin ɽsĶӨӡA
榡Nwqb xcin-2.5/src/util/cin2tab/gencin.c AFVjMH~A
٥]tFϦVjMAOiHѤ@ӤrϬdbYJk keystroke:                        

.tab 榡]AHUXӳ:

name            size (# of bytes)               description
===========================================================================
modID:          MODULE_ID_SIZE                  ID of the readable module  
th:             sizeof(cintab_head_t)           Header of the IM         
icode_idx:      sizeof(icode_idx_t)*th.n_icode  idx for keystroke searching
ichar:          sizeof(ichar)*th.n_icode        idx for char searching     
icode1:         sizeof(icode_t)*th.n_icode      keystroke 1-5
icode2:         sizeof(icode_t)*th.n_icode      keystroke 6-10

䤤 sizeof(icode_t) = 4, icode_t OΨxsr keystroke, @
icode1 ̦hiHxsӽXAoO@JkpCpGWLӽXܡA
hٻݭn icode2, G gen_inp ثe̦hBzQӽXJkCpGӿJ
k̦hXƤWLܡA .tab ɴN]t icode2, `٪ŶC       

icode_idx Ω󥿬dA ichar ΩϬdCdBJ:
(Ԩ xcin-2.5/src/Cinput/gen_inp/gen_inp.c)     

1. NϥΪ̿J keystroke rsXA icode_t 榡C
   (ϥ keys2codes 禡)

2. q icode1 P icode2 }CjMAPϥΪ̿J keystroke 
   icode_t ۲ŪAǦ^b}C index: idx C                 

3. icode_idx[idx] ȧYŦX keystroke rX (ichar_t 榡)A
   oɥ ccode_to_char 禡N^ӤrX (p Big5 X)

ϬdBJ:

1. NϬdrX (p Big5 X) sXA ichar_t 榡AY 
   index iC (ϥ ccode_to_idx 禡)

2. idx = ichar[i] ȧY icode1 P icode2 }C index C

3.  codes2keys 禡N icode1[idx] P icode2[idx] ٭쬰 keystroke C

boاڭ̦PɱN keystroke PrXsXxsFAoOF
`ٰO骺ϥζq (sizeof(icode_idx_t)=2, sizeof(ichar_t)=2, ]NO 
 gen_inp ̦hBz 65565 Ӧr keystroke)CӳoǽsX禡b   
xcin-2.5/src/Cinput/im_comm YC


T.H.Hsieh
