以左軟體lsk為例,當有標籤時,按下lsk可以執行響應功能;當沒有標籤(null)時,按下lsk就無反應。
例如:開啟**簿資料保密時,進入**簿要求輸入4位密碼,當輸入不足4位時,左軟體標籤為空,達到4為時,左軟體標籤為ok。
剛進入輸入密碼介面函式entryrstcheckphonelock()時,註冊registerinputboxvalidationfunction(rstrsettingpasswdscrsoftkeyfunc); 用來控制左軟體的標籤顯示問題。
1. 當輸入不滿4位時,
changeleftsoftkey(0, 0);
change_left_softkey(0, 0);
mmi_softkeys[key].text = null,
redraw_softkey(mmi_left_softkey);
show_softkey(mmi_left_softkey);
if ((mmi_softkeys[key].text == null) && (mmi_softkeys[key].normal_up_icon == null))
clear_softkey_handler(mmi_left_softkey);
clearkeyhandler(key_lsk, key_event_down);
設定currkeyfuncptrs[key_lsk][ key_event_down] = null;
clearkeyhandler(key_lsk, key_event_up);
設定currkeyfuncptrs[key_lsk][ key_event_up] = null;
按下lsk時,進入:
executecurrkeyhandler()
獲取按鍵響應:currfuncptr = currkeyfuncptrs[keycode][keytype]; 不論是down還是up,都為null,因此沒有響應!!!
2. 當輸入滿4位時,
enableleftsoftkey(str_global_ok, img_global_ok);
mmi_softkeys[key].text = ok
redraw_left_softkey()
redraw_softkey()
show_softkey()因為mmi_softkeys[key].text不為null,因此不會執行clear_softkey_handler()
register_left_softkey_handler()
register_softkey_handler(mmi_left_softkey)
setkeyhandler(left_softkey_down, key_lsk, key_event_down);
設定currkeyfuncptrs[key_lsk][ key_event_down] = left_softkey_down;
setkeyhandler(left_softkey_up, key_lsk, key_event_up);
設定currkeyfuncptrs[key_lsk][ key_event_down] = left_softkey_up;
按下lsk時,進入:
executecurrkeyhandler()
獲取按鍵響應:currfuncptr = currkeyfuncptrs[keycode][keytype];
分別進入響應:left_softkey_down()
execute_softkey_function(key_event_down, mmi_left_softkey);
softkey_functions[key][k] ()
執行註冊的down響應函式
left_softkey_up()
execute_softkey_function(key_event_up, mmi_left_softkey);
softkey_functions[key][k] ();
執行註冊的up響應函式
小結:當lsk, rsk沒有標籤時,設定currkeyfuncptrs 對應響應為null;
當lsk, rsk有標籤時,設定currkeyfuncptrs 對應響應為:left_softkey_down(), left_softkey_up(), right_softkey_down(),right_softkey_up();
當按下/抬起lsk, rsk時,先判斷currkeyfuncptrs 中是否有響應,有則執行。因此,如果沒有標籤,則不執行。
標籤與標籤區別
標籤告訴瀏覽器把其中的文字表示為強調的內容。把這段文字用斜體來顯示。盡 管現在 標籤修飾的內容都是用斜體字來顯示,但這些內容也具有更廣泛的含義,將來的某一天,瀏覽器也可能會使用其他的特殊效果來顯示強調的文字。如果只想使用斜體 字來顯示文字的話,請使用 標籤。除此之外,文件中還可以包括用來改變文字顯示...
請求與響應
響應頭 content type refresh location等等 案例 定時重新整理,設定refresh resp.setheader refresh 3 url day03 bservlet 禁用瀏覽器快取,cache control,pragma,expires 標籤可以代替響應頭 響應體...
HTTP的請求與響應
字數449 閱讀22 喜歡0 accept 瀏覽器通過這個頭告訴伺服器,它所支援的資料型別 accept charset 瀏覽器通過這個頭告訴伺服器,它支援哪種字符集 accept encoding 瀏覽器通過這個頭告訴伺服器,支援的壓縮格式 accept language 瀏覽器通過這個頭告訴伺服...