簡單的minigui軟鍵盤
2023年04月28日 星期六 下午 05:36
由於已經購買mgi模組,故而自己寫的這個用不著了,留在這裡做個記念吧。以下是關鍵**,其實思想蠻簡單,就是傳送訊息給輸入法視窗就萬事大 吉了。但是有個最重要的bug就是中文輸入無法選擇所有的漢字,估計要改一下minigui輸入法的原始碼,mgi的軟鍵盤是利用了兩行。示例圖如下,很簡 陋,如果經過美化,可以做到很漂亮。
#include"common.h"#defineitem_num1 14
/* coolbar */
#defineitem_num2 14
/* coolbar */
#defineitem_num3 12
/* coolbar */
#defineitem_num4 12
/* coolbar */
#defineitem_num5 8
/* coolbar */
#defineidc_novaskb1 1001
/* ime */
#defineidc_novaskb2 1002
/* ime */
#defineidc_novaskb3 1003
/* ime */
#defineidc_novaskb4 1004
/* ime */
#defineidc_novaskb5 1005
/* ime */
#defineheight_skb 115
/* 軟鍵盤 */
#definewidth_skb 240
/* 軟鍵盤 */
staticconstchar* caption1 =
;staticconstintscancode1 =
;staticconstchar* caption2 =
;staticconstintscancode2 =
;staticconstchar* caption3 =
;staticconstintscancode3 =
;staticconstchar* caption4 =
;staticconstintscancode4 =
;staticconstchar* caption5 =
;staticconstintscancode5 =
;staticvoidcreate_novaskb1 (hwnd hwnd)
/* del 按鍵 */
item.inspos = i;
item.id = i;
item.itemtype = type_bmpitem;
item.bmp =
&del_bmp;
item.itemhint = null;
item.caption = null;
item.dwadddata=
0;sendmessage (cb, cbm_additem, 0, (lparam)&item);
}staticvoidcreate_novaskb2 (hwnd hwnd)
}staticvoidcreate_novaskb3 (hwnd hwnd)
}staticvoidcreate_novaskb4 (hwnd hwnd)
}staticvoidcreate_novaskb5 (hwnd hwnd)
#if1
/* down 按鍵 */
item.inspos = i;
item.id = i;
item.itemtype = type_bmpitem;
item.bmp =
&down_bmp;
item.itemhint = null;
item.caption = null;
item.dwadddata=
0;sendmessage (cb, cbm_additem, 0, (lparam)&item);
/* up 按鍵 */
i++;
item.inspos = i;
item.id = i;
item.itemtype = type_bmpitem;
item.bmp =
&up_bmp;
item.itemhint = null;
item.caption = null;
item.dwadddata=
0;sendmessage (cb, cbm_additem, 0, (lparam)&item);
/* left 按鍵 */
i++;
item.inspos = i;
item.id = i;
item.itemtype = type_bmpitem;
item.bmp =
&left_bmp;
item.itemhint = null;
item.caption = null;
item.dwadddata=
0;sendmessage (cb, cbm_additem, 0, (lparam)&item);
/* right 按鍵 */
i++;
item.inspos = i;
item.id = i;
item.itemtype = type_bmpitem;
item.bmp =
&right_bmp;
item.itemhint = null;
item.caption = null;
item.dwadddata=
0;sendmessage (cb, cbm_additem, 0, (lparam)&item);
#endif
}staticintnovaskbproc(hwnd hwnd,intmessage, wparam wparam, lparam lparam)
elseif(code ==
2)else
break;}}
break;
casemsg_keydown:
send2activeclient (msg_keydown, wparam, lparam);
break;
casemsg_destroy:
destroyallcontrols (hwnd);
return0;
casemsg_close:
destroymainwindow (hwnd);
postquitmessage (hwnd);
return0;
}returndefaultmainwinproc(hwnd, message, wparam, lparam);
}staticvoidinitnovaskbcreateinfo (pmainwincreate pcreateinfo,intx,inty)
hwnd novaskbwindow(hwnd hosting,intx,inty)
Android軟鍵盤的控制以及更改軟鍵盤
edittext是可編輯控制項,往往會為它新增監聽,在軟鍵盤上也會有行為。1 隱藏軟鍵盤 inputmethodmanager imm inputmethodmanager getsystemservice context.inputmethodservice imm.hidesoftinputfr...
開啟軟鍵盤
win32的話話,要是這幾個函式sipinfo shsipinfo sipsetinfo sipgetinfo net底下有個inputpanel設定他的enable就ok了。隱藏輸入面板 bool lowersip return fres 公升起輸入面板 bool raisesip void re...
關於軟鍵盤
1.editext獲得焦點後自動彈出軟鍵盤的呼叫方法 檢視edittext原始碼,找到editext的父類textview,在ontouchevent方法中找到如下 if touchisfinished istexteditable textisselectable the above condit...