nlpguyz / hackerskeyboard

Hacker's Keyboard on RIME (official) 黑客键盘中州韵版
22 stars 3 forks source link

Call sequence for RIME api #4

Closed nlpguyz closed 6 years ago

nlpguyz commented 6 years ago

r = $sys.mRime

// List schemata s = r.getSchemaNames() for (i = 0; i < s.length; i++) print(s[i] + "\n");

// List selected schemata ss = r.get_selected_schema_list() print(ss)

nlpguyz commented 6 years ago

key_b = [98, 0]; // b key_o = [111, 0]; // o key_1 = [49, 0]; // 1

r = $sys.mRime; r.onKey(key_b); r.onKey(key_o);

// Check composition print(r.getCompositionText()) // should show 'bo'

// select 1

r.onKey(key_1); print(r.getCompositionText()) // composition should be empty

// type 'bo' again

r.onKey(key_b); r.onKey(key_o);

print(r.getComposingText()) // should show '波'

// Check candidates c=r.getCandidates();

for (i = 0; i < c.length; i++) print(c[i]);

波, null博, null播, null撥, null伯, null

nlpguyz commented 6 years ago

Test page up/down

key_pu = [65365, 0] key_pd = [65366, 0]

rel = r.get_modifier_by_name("Release") // 1073741824

key_pur = [65365, rel] key_pdr = [65366, rel]

r.onKey(key_pd);

// Check candidates c=r.getCandidates();

for (i = 0; i < c.length; i++) print(c[i]);

薄, null啵, null剝, null搏, null泊, null