We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
根据7.6 自定义键盘的做法实现了一个键盘页面。
实现思路是大写键盘,小写键盘,数字键盘各自分了一个page来实现大小写和输入数字,但是发现切换page的时候焦点只有实际程序焦点的切换,但是焦点样式却没有跟着过来,鼠标移动到这个按钮的时候才会刷新成正常的样式。 我试了下在按键事件里面widget_set_focused和在idle_queue函数里面widget_set_focused都没有用,这个有没有解决的方法?
谢谢。 键盘样式: default.xml
<battery_widget> <style name="default"> <normal font_size="32" text_color="#000000"/> </style> </battery_widget> <border_text> <style name="default"> <normal font_size="32" text_color="#000000"/> </style> </border_text> <button> <style name="default" bg_color="#FFFFFF" round_radius="6" text_color="#FFFFFF"> <normal border_color="#C3C3C3" text_color="#151515"/> <disable border_color="#D9D9D9" text_color="#BEBEBE"/> <focused border_color="#3B9AFC" text_color="#7A7A7A"/> <over bg_color="linear-gradient(180deg, #0C80FF 0%, #6AB2FA 100%)" border_color="#00000000" border_width="0"/> <pressed bg_color="#007AEB" border_color="#0071EB"/> </style> <style name="arrow_btn" bg_color="#00000000" border_color="#00000000" font_size="25" round_radius="6" text_color="#577699"> <normal/> <focused border_color="#00FFFF"/> <pressed text_color="#00FFFF"/> </style> <style name="bottom_tab_btn" bg_color="#00000000" border_color="#00000000" font_name="Inter_18pt_Medium" font_size="25" icon="icons_Group_3214" icon_at="left" text_align_h="right" text_color="#00C2FF"> <normal icon="icons_Group_3588" text_color="#FFFFFF"/> <disable_of_checked/> <focused border_color="#00FFFF" icon="icons_Group_3588" text_color="#FFFFFF"/> <focused_of_checked/> <normal_of_checked/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="bottom_tab_btn2" bg_color="#00000000" border_color="#00000000" font_name="Inter_18pt_Medium" font_size="25" icon="menu_btn_gear0" icon_at="left" text_align_h="right" text_color="#00C2FF"> <normal text_color="#FFFFFF"/> <disable_of_checked/> <focused icon="menu_btn_gear1"/> <focused_of_checked/> <normal_of_checked/> <over_of_checked/> <pressed icon="menu_btn_gear1" y_offset="2"/> <pressed_of_checked/> </style> <style name="combobox_down" bg_color="#FAFAFA" border_color="#C2C2C2" border_width="1" icon="combo_arrow_n"> <normal border="left"/> <focused border="left"/> <over bg_color="linear-gradient(180deg, #0C80FF 0%, #6AB2FA 100%)" border_color="#2F8DFC" border_width="0" icon="combo_arrow_o" round_radius_bottom_right="6" round_radius_top_left="0" round_radius_top_right="6"/> <pressed bg_color="#007AFF" border_color="#2F8DFC" icon="combo_arrow_p" round_radius_bottom_right="6" round_radius_top_right="6"/> </style> <style name="confirm_button" bg_color="#11487B7B" font_name="400Inter_Regular" font_size="24" round_radius="0" text_color="#FFFFFF"> <normal border_color="#0F395F00"/> <focused border_color="#00FFFF"/> <pressed bg_color="#00C2FF" border_color="#00000000"/> </style> <style name="empty_btn" bg_color="#00000000" border_color="#00000000" round_radius="0" text_align_h="left"> <normal/> <disable/> <focused border_color="#00FFFF"/> <over/> <pressed/> </style> <style name="initial_select" bg_color="#11487B" border_color="#00000000" font_name="400Inter_Regular" font_size="24" round_radius="6" text_color="#FFFFFF"> <normal/> <focused border_color="#00FFFF"/> <pressed bg_color="#00C2FF"/> </style> <style name="kb_key_onwa" border_color="#00000000" font_name="400Inter_Regular" font_size="30" round_radius="0" text_color="#FFFFFF"> <normal bg_color="#073967"/> <focused bg_color="#11487B" border_color="#00FFFF"/> <pressed bg_color="#00C2FF"/> </style> <style name="kp25_shell_button" bg_color="#00000000" round_radius="6" text_color="#151515"> <normal border_color="#00000000"/> <pressed border_color="#00FFFF"/> </style> <style name="manual_button" bg_color="linear-gradient(180deg, #01467A 0%, #012541 100%)" round_radius="0" text_color="#151515"> <normal border_color="#ACDEEA"/> <focused border_color="#00FFFF"/> <pressed bg_color="#00C2FF" border_color="#00C2FF"/> </style> <style name="manual_tri_down" bg_image="manual_tri1" border_color="#00000000" round_radius="0" text_color="#00000000"> <normal bg_color="#00000000"/> <focused border_color="#00FFFF"/> <pressed bg_color="#00000000" bg_image="manual_tri3"/> </style> <style name="manual_tri_up" bg_color="#00000000" bg_image="manual_tri2" border_color="#00000000" round_radius="0" text_color="#00000000"> <normal/> <focused border_color="#00FFFF"/> <pressed bg_image="manual_tri4"/> </style> <style name="menu_back" bg_color="#00000000" bg_image_draw_type="center" border_color="#00000000" icon="icon_onwa_arrow_left" round_radius="0" text_align_h="left" text_color="#FFFFFF"> <normal icon_at="auto"/> <disable/> <focused border_color="#00FFFF"/> <over/> <pressed bg_color="#00C2FF" border_color="#00C2FF00"/> </style> <style name="menu_page_btn" font_name="Inter_18pt_Medium" font_size="20" icon="1_3_btn_accuvisionActive" icon_at="top" spacer="9" text_color="#E7E6E6"> <normal icon="1_3_btn_accuvision"/> <focused border_color="#00000000" text_color="#00FFFF"/> <focused_of_checked icon="1_3_btn_accuvision"/> <over text_color="#00FFFF"/> <pressed border_color="#00000000" text_color="#00DDED"/> </style> <style name="option_box" bg_color="#00000000" border_color="#00000000" font_size="25" round_radius="4"> <normal text_color="#577D99"/> <focused border_color="#00FFFF" text_color="#444444"/> <pressed text_color="#00FFFF"/> </style> <style name="setting_onwa" bg_color="#0F395F" border_color="#00000000" font_size="25" round_radius="6" text_color="#FFFFFF"> <normal/> <focused border_color="#00FFFF"/> <pressed bg_color="#00F0FF"/> </style> <style name="sonar_icon" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" border_color="#363B46" border_width="1" icon="sonar_btn_home0" icon_at="center" round_radius="5" text_color="#FFFFFF"> <normal border="bottom" border_color="#00000000" border_width="0" font_name="default"/> <disable border="bottom" font_name="default"/> <focused border_color="#00FFFF" font_name="default"/> <over border="bottom" font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="sonar_icon_add" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" icon="sonar_btn_add0" icon_at="center" round_radius="5" round_radius_bottom_right="0" round_radius_top_right="0" text_color="#FFFFFF"> <normal font_name="default"/> <disable font_name="default" icon="sonar_btn_add2"/> <focused font_name="default"/> <over font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="sonar_icon_home" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" border_color="#363B46" border_width="1" icon="sonar_btn_home0" icon_at="center" round_radius="5" text_color="#FFFFFF"> <normal border="bottom" border_color="#00000000" border_width="0" font_name="default"/> <disable border="bottom" font_name="default"/> <focused border_color="#00FFFF" font_name="default"/> <over border="bottom" font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="sonar_icon_menu" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" icon="sonar_btn_menu0" icon_at="center" round_radius="5" text_color="#FFFFFF"> <normal font_name="default"/> <disable font_name="default"/> <focused font_name="default"/> <over font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="sonar_icon_sub" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" icon="sonar_btn_sub0" icon_at="center" round_radius="5" round_radius_bottom_left="0" round_radius_top_left="0" text_color="#FFFFFF"> <normal font_name="default"/> <disable font_name="default" icon="sonar_btn_sub2"/> <focused font_name="default"/> <over font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="spinbox_down" border_color="#2F8DFC" border_width="1" icon_at="auto"> <normal bg_color="#F5F5F5" border="left" border_color="#C2C2C2" icon="spin_down_arrow_n"/> <over bg_color="linear-gradient(180deg, #0C80FF 0%, #6AB2FA 100%)" icon="spin_down_arrow_o" round_radius_bottom_right="6"/> <pressed bg_color="#007AFF" border="all" icon="spin_down_arrow_p" round_radius_bottom_right="6"/> </style> <style name="spinbox_up" border_color="#2F8DFC"> <normal bg_color="#FAFAFA" border="left" border_color="#C2C2C2" icon="spin_up_arrow_n"/> <over bg_color="linear-gradient(180deg, #6AB2FA 0%, #0C80FF 100%)" icon="spin_up_arrow_o" round_radius_top_right="6"/> <pressed bg_color="#007AFF" border="all" icon="spin_up_arrow_p" round_radius_bottom_left="0" round_radius_top_right="6"/> </style> <style name="tutorial_ex_close" bg_color="#002B4B" bg_image="btn_close_normal_png" border_width="0" round_radius="0" text_color="#FFFFFF"> <normal/> <focused border_color="#00FFFF" border_width="1"/> <pressed bg_image="btn_close_pressed_png"/> </style> <style name="tutorial_exit" font_name="400Inter_Regular" font_size="20" round_radius="4" text_color="#FFFFFF"> <normal bg_color="#00000000" border_color="#FFFFFF"/> <focused bg_color="#2E74B5" border_color="#00FFFF" text_color="#00FFFF"/> <pressed bg_color="#00C2FF" border_color="#00000000"/> </style> <style name="tutorial_expand" bg_color="#298EAD7F" bg_image="btn_expand_normal_png" border_width="0" round_radius="0" text_color="#FFFFFF"> <normal/> <focused bg_image_draw_type="center" border_color="#00FFFF" border_width="1"/> <pressed/> </style> <style name="tutorial_next" border_color="#00FFFF" font_name="400Inter_Regular" font_size="20" round_radius="4" text_color="#00FFFF"> <normal bg_color="#00000000"/> <focused bg_color="#2E74B5"/> <pressed bg_color="#00C2FF" border_color="#00000000"/> </style> </button> <candidates> <style name="default"> <normal bg_color="#ECECEC" text_color="#151515"/> </style> </candidates> <check_button> <style name="default" text_color="#4D4D4D"> <normal icon="check_n"/> <disable icon="check_d"/> <disable_of_checked icon="check_checked_d"/> <focused icon="check_f"/> <focused_of_checked icon="check_checked_f"/> <normal_of_checked icon="check_checked_n"/> <over icon="check_o"/> <over_of_checked icon="check_checked_o"/> <pressed icon="check_p"/> <pressed_of_checked icon="check_checked_p"/> </style> <style name="auto_range" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" border="left|right" border_color="#4E5560" border_width="1" icon="sonar_btn_touch0" icon_at="center" round_radius="0" text_color="#FFFFFF"> <normal font_name="default"/> <disable font_name="default"/> <focused font_name="default"/> <normal_of_checked font_name="default" icon="sonar_btn_auto0"/> <over font_name="default"/> <over_of_checked font_name="default" icon="sonar_btn_auto0"/> <pressed bg_color="#00C2FF"/> <pressed_of_checked bg_color="#00C2FF" font_name="default" icon="sonar_btn_auto0"/> </style> </check_button> <color_tile> <style name="default" border_width="1" round_radius="5"> <normal bg_color="#FFFFFF" border="all" border_color="#CBCBCB"/> <focused bg_color="#FFFFFF" border_color="#0A85FF"/> <over border_color="#3A9BFC"/> </style> </color_tile> <combo_box_ex> <style name="default" bg_color="#FFFFFF" border_color="#0A84FF" border_width="1" margin_left="10" round_radius="5" selected_bg_color="#007BFD" selected_fg_color="#000000" selected_text_color="#FFFFFF" text_align_h="left" text_color="#000000" tips_text_color="#AEAEAF"> <normal border_color="#CBCBCB"/> <disable border_color="#B0B0B0" text_color="#B0B0B0"/> <empty border_color="#CBCBCB" text_color="#AEAEAF"/> <empty_focus text_color="#AEAEAF"/> <empty_over text_color="#AEAEAF"/> <error border_color="#FF0000"/> <focused/> <over/> </style> </combo_box_ex> <combo_box_item> <style name="default" bg_color="#007AFF" icon_at="left" margin_left="10" text_color="#FFFFFF"> <normal bg_color="#ECECEC" text_color="#000000"/> <disable bg_color="#ECECEC" text_color="#BDBDBD"/> <disable_of_checked text_color="#00000000"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over bg_color="#3C9AFC"/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> </combo_box_item> <dialog> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3" round_radius="6"/> </style> </dialog> <digit_clock> <style name="default"> <normal border="none" border_color="#00000000" border_width="1" text_color="#4D4D4D"/> </style> <style name="system_bar_digit_clock"> <normal border_color="#00000000" border_width="1" icon="battery_s" icon_at="right" margin_left="16" text_color="#4D4D4D"/> </style> </digit_clock> <dragger> <style name="default"> <normal bg_color="#FFFFFF" text_color="#3B3B3B"/> </style> <style name="scroll_bar" round_radius="6" text_color="#3B3B3B"> <normal bg_color="#919191"/> <over bg_color="#9DCDFD"/> <pressed bg_color="#007AFF"/> </style> </dragger> <edit> <style name="default" bg_color="#FFFFFF" border_color="#0A84FF" border_width="1" margin_left="10" round_radius="5" selected_bg_color="#007BFD" selected_fg_color="#000000" selected_text_color="#FFFFFF" text_align_h="left" text_color="#000000" tips_text_color="#AEAEAF"> <normal border_color="#CBCBCB"/> <disable border_color="#B0B0B0" text_color="#B0B0B0"/> <empty border_color="#CBCBCB" text_color="#AEAEAF"/> <empty_focus text_color="#AEAEAF"/> <empty_over text_color="#AEAEAF"/> <error border_color="#FF0000"/> <focused/> <over/> </style> <style name="edit_onwa" bg_color="#00000000" border_color="#274C6A" border_width="1" margin_left="10" round_radius="0" selected_bg_color="#00FFFF" selected_fg_color="#000000" selected_text_color="#FFFFFF" text_color="#FFFFFF" tips_text_color="#577D9900"> <normal font_size="25" text_align_h="center"/> <changed text_align_h="left"/> </style> <style name="kb_onwa" border="bottom" border_color="#CFE8F9" border_width="1" margin_left="10" round_radius="0" selected_fg_color="#000000" selected_text_color="#FFFFFF" text_align_h="left" text_color="#FFFFFF"> <normal bg_color="#002C54" font_name="Inter_18pt_Regular" font_size="34" selected_bg_color="#002C54" tips_text_color="#00000000"/> <changed bg_color="#FFFFFF" selected_bg_color="#007BFD" tips_text_color="#AEAEAF"/> </style> </edit> <gauge> <style name="default"> <normal bg_image="guage_bg" bg_image_draw_type="scale"/> </style> </gauge> <gauge_pointer> <style name="default"> <normal bg_image="guage_pointer" bg_image_draw_type="scale"/> </style> </gauge_pointer> <label> <style name="default"> <normal text_color="#444444"/> <disable text_color="#44444466"/> </style> <style name="ocean"> <normal border_color="#113554" text_color="#FFFFFF"/> </style> <style name="ocean_no_border"> <normal text_color="#527894"/> </style> <style name="option_box" bg_color="#002444" font_size="25" text_color="#FFFFFF"> <normal border_color="#416683"/> <focused border_color="#00FFFF"/> </style> <style name="range_slider_default" border_color="#113554" font_size="23" text_color="#FFFFFF"> <normal/> <focused/> </style> <style name="range_slider_default_no_border"> <normal font_size="23" text_color="#527894"/> </style> <style name="setting_name" bg_color="#002444" font_name="default" font_size="25" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal/> <focused border_color="#00FFFF"/> </style> <style name="setting_title" font_name="400Inter_Regular" font_size="20" text_align_h="left" text_color="#506F87EA"> <normal/> <focused border_color="#00FFFF"/> </style> <style name="system_bar_title"> <normal margin_left="3" text_color="#151515"/> </style> </label> <line_number> <style name="default" text_align_h="right"> <normal bg_color="#F7F3F7" text_color="#787878"/> <disable bg_color="#D0D0D066" text_color="#44444466"/> </style> </line_number> <list_item> <style name="default" border_width="0" margin_left="10" text_align_h="left" text_color="#FFFFFF"> <normal bg_color="#ECECEC" text_color="#4D4D4D"/> <over bg_color="#3A9BFC"/> <pressed bg_color="#007AFF"/> </style> </list_item> <list_view> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> </list_view> <list_view_h> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> </list_view_h> <mledit> <style name="default" bg_color="#FFFFFF" border_color="#D0D0D0" margin_left="35" selected_bg_color="#007BFD" selected_text_color="#FFFFFF" text_color="#AEAEAF"> <normal text_color="#000000"/> <disable bg_color="#B0B0B0" text_color="#B0B0B0"/> <empty/> <empty_focus/> <empty_over/> <focused text_color="#000000"/> </style> </mledit> <option_box> <style name="default"> <normal font_size="32" text_color="#000000"/> </style> </option_box> <overlay> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> </overlay> <pages> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> </pages> <popup> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> <style name="combobox_popup"> <normal bg_color="#ECECEC" border_color="#D3D3D3" border_width="1"/> </style> </popup> <progress_bar> <style name="default"> <normal bg_color="#D8D8D8" border_color="#CDCDCD" border_width="1" fg_color="#007AFF" round_radius="5"/> </style> </progress_bar> <progress_circle> <style name="default"> <normal bg_color="#D8D8D8" fg_color="#007AFF" font_size="25" text_color="#000000"/> </style> </progress_circle> <radio_button> <style name="default" text_color="#4D4D4D"> <normal icon="radio_n"/> <disable icon="radio_d"/> <disable_of_checked icon="radio_checked_d"/> <focused icon="radio_f"/> <focused_of_checked icon="radio_checked_f"/> <normal_of_checked icon="radio_checked_n"/> <over icon="radio_o"/> <over_of_checked icon="radio_checked_o"/> <pressed icon="radio_p"/> <pressed_of_checked icon="radio_checked_p"/> </style> <style name="addto_left1" bg_image="addto_left1_1"> <normal bg_image="addto_left1_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_left2" bg_image="addto_left2_1"> <normal bg_image="addto_left2_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_left3" bg_image="addto_left3_1"> <normal bg_image="addto_left3_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_left4" bg_image="addto_left4_1"> <normal bg_image="addto_left4_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_left5" bg_image="addto_left5_1"> <normal bg_image="addto_left5_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_left6" bg_image="addto_left6_1"> <normal bg_image="addto_left6_0"/> <focused/> <focused_of_checked/> <normal_of_checked/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_middle1" bg_image_draw_type="scale" border_color="#00F0FF" border_width="5" font_name="Inter_18pt_Bold" font_size="63" icon="addto_tag1_1" icon_at="center" text_color="#00F0FF"> <normal border_color="#AFD6F2" icon="addto_tag1_0" text_color="#AFD6F2"/> <focused/> <focused_of_checked/> <normal_of_checked border_color="#AFD6F2"/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_middle2" bg_image_draw_type="scale" border_color="#00F0FF" border_width="5" font_name="Inter_18pt_Bold" font_size="63" icon="addto_tag2_1" icon_at="center" text_color="#00F0FF"> <normal border_color="#AFD6F2" icon="addto_tag2_0" text_color="#AFD6F2"/> <focused/> <focused_of_checked/> <normal_of_checked border_color="#AFD6F2"/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_middle3" bg_image_draw_type="scale" border_color="#00F0FF" border_width="5" font_name="Inter_18pt_Bold" font_size="63" icon="addto_tag3_1" icon_at="center" text_color="#00F0FF"> <normal border_color="#AFD6F2" icon="addto_tag3_0" text_color="#AFD6F2"/> <focused/> <focused_of_checked/> <normal_of_checked border_color="#AFD6F2"/> <over/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="addto_right1" bg_image="addto_right1_2"> <normal bg_image="addto_right1_0"/> <focused bg_image="addto_right1_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right1_1"/> <over_of_checked/> <pressed bg_image="addto_right1_1"/> <pressed_of_checked/> </style> <style name="addto_right2" bg_image="addto_right2_2"> <normal bg_image="addto_right2_0"/> <focused bg_image="addto_right2_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right2_1"/> <over_of_checked/> <pressed bg_image="addto_right2_1"/> <pressed_of_checked/> </style> <style name="addto_right3" bg_image="addto_right3_2"> <normal bg_image="addto_right3_0"/> <focused bg_image="addto_right3_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right3_1"/> <over_of_checked/> <pressed bg_image="addto_right3_1"/> <pressed_of_checked/> </style> <style name="addto_right4" bg_image="addto_right4_2"> <normal bg_image="addto_right4_0"/> <focused bg_image="addto_right4_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right4_1"/> <over_of_checked/> <pressed bg_image="addto_right4_1"/> <pressed_of_checked/> </style> <style name="addto_right5" bg_image="addto_right5_2"> <normal bg_image="addto_right5_0"/> <focused bg_image="addto_right5_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right5_1"/> <over_of_checked/> <pressed bg_image="addto_right5_1"/> <pressed_of_checked/> </style> <style name="addto_right6" bg_image="addto_right6_2"> <normal bg_image="addto_right6_0"/> <focused bg_image="addto_right6_1"/> <focused_of_checked/> <normal_of_checked/> <over bg_image="addto_right6_1"/> <over_of_checked/> <pressed bg_image="addto_right6_1"/> <pressed_of_checked/> </style> <style name="bottom_tab_btn" bg_color="#00000000" border_color="#00000000" font_name="Inter_18pt_Medium" font_size="25" icon="icons_Group_3214" icon_at="left" text_align_h="right" text_color="#00C2FF"> <normal icon="icons_Group_3588" text_color="#FFFFFF"/> <disable_of_checked/> <focused border_color="#00FFFF" icon="icons_Group_3588" text_color="#FFFFFF"/> <focused_of_checked/> <normal_of_checked/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="bottom_tab_btn2" bg_color="#00000000" border_color="#00000000" font_name="Inter_18pt_Medium" font_size="25" icon="menu_btn_gear0" icon_at="left" text_align_h="right" text_color="#00C2FF"> <normal text_color="#FFFFFF"/> <disable_of_checked/> <focused icon="menu_btn_gear1" text_color="#FFFFFF"/> <focused_of_checked/> <normal_of_checked/> <over_of_checked/> <pressed/> <pressed_of_checked/> </style> <style name="color_setting" bg_color="#002444" border_width="0" font_size="25" icon="" margin_left="5" margin_top="5" round_radius="5" text_align_h="left" text_align_v="top" text_color="#FFFFFF"> <normal/> <disabled_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <focused bg_image="" bg_image_draw_type="scale" border_color="#00FFFF" border_width="1" icon_at="auto"/> <focused_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" border_color="#00FFFF" border_width="1" icon_at="auto" margin_right="0"/> <normal_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <over border_color="#00FFFF" border_width="1"/> <over_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <pressed_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> </style> <style name="no_dragger" bg_color="#00000000" round_radius="4" text_color="#00000000"> <normal/> <focused/> <focused_of_checked/> </style> <style name="ocean" bg_color="#00000000" bg_image="icons_slider_3" round_radius="4" text_color="#00000000"> <normal bg_image="icons_slider_2" icon="" icon_at="auto"/> <disable_of_checked icon="" icon_at="auto"/> <focused bg_image="icons_slider_2" border_color="#00FFFF"/> <focused_of_checked border_color="#00FFFF" icon="" icon_at="auto"/> <normal_of_checked icon="" icon_at="auto"/> <over_of_checked icon="" icon_at="auto"/> <pressed/> <pressed_of_checked icon="" icon_at="auto"/> </style> <style name="onwa_radio" bg_color="#002444" border_width="0" font_name="default" font_size="25" icon="1_3_icon_Vector_273" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal icon=""/> <disabled_of_checked icon_at="right"/> <focused border_color="#00FFFF" border_width="1" icon=""/> <focused_of_checked border_color="#00FFFF" border_width="1" icon_at="right"/> <normal_of_checked icon_at="right"/> <over border_color="#00FFFF" border_width="1" icon=""/> <over_of_checked icon_at="right"/> <pressed_of_checked icon_at="right"/> </style> <style name="onwa_radio2" bg_color="#002444" border_width="0" font_name="default" font_size="25" icon="" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal/> <disabled_of_checked bg_image="radio_active_bg2" bg_image_draw_type="scale" icon_at="auto"/> <focused border_color="#00FFFF" border_width="1"/> <focused_of_checked bg_image="radio_active_bg2" bg_image_draw_type="scale" border_color="#00FFFF" border_width="1" icon_at="auto"/> <normal_of_checked bg_image="radio_active_bg2" bg_image_draw_type="scale" icon_at="auto"/> <over border_color="#00FFFF" border_width="1"/> <over_of_checked bg_image="radio_active_bg2" bg_image_draw_type="scale" icon_at="auto"/> <pressed_of_checked bg_image="radio_active_bg2" bg_image_draw_type="scale" icon_at="auto"/> </style> <style name="onwa_radio3" bg_color="#002444" border_width="0" font_name="default" font_size="25" icon="" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal/> <disabled_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <focused border_color="#00FFFF" border_width="1"/> <focused_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" border_color="#00FFFF" border_width="1" icon_at="auto"/> <normal_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <over border_color="#00FFFF" border_width="1"/> <over_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> <pressed_of_checked bg_image="radio_active_bg3" bg_image_draw_type="scale" icon_at="auto"/> </style> <style name="onwa_radio4" bg_color="#002444" border_width="0" font_name="default" font_size="25" icon="" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal/> <disabled_of_checked bg_image="radio_active_bg4" bg_image_draw_type="scale" icon_at="auto"/> <focused border_color="#00FFFF" border_width="1"/> <focused_of_checked bg_image="radio_active_bg4" bg_image_draw_type="scale" border_color="#00FFFF" border_width="1" icon_at="auto"/> <normal_of_checked bg_image="radio_active_bg4" bg_image_draw_type="scale" icon_at="auto"/> <over border_color="#00FFFF" border_width="1"/> <over_of_checked bg_image="radio_active_bg4" bg_image_draw_type="scale" icon_at="auto"/> <pressed_of_checked bg_image="radio_active_bg4" bg_image_draw_type="scale" icon_at="auto"/> </style> <style name="radio_left_margined_onwa" font_size="25" icon="icon_onwa_radio_Group_3605" icon_at="left" margin_left="10" round_radius="5" text_color="#FFFFFF"> <normal icon="icons_Rectangle_5365"/> <disable_of_checked/> <focused border_color="#00FFFF" icon="icons_Rectangle_5365"/> <focused_of_checked border_color="#00FFFF"/> <normal_of_checked margin_right="0"/> <over_of_checked/> <pressed_of_checked margin_right="0"/> </style> <style name="range_slider_default" bg_color="#00000000" bg_image="range_silder_dragger0" round_radius="4" text_color="#00000000"> <normal icon="" icon_at="auto"/> <disable_of_checked icon="" icon_at="auto"/> <focused border_color="#00FFFF"/> <focused_of_checked bg_image="range_silder_dragger1" border_color="#00FFFF" icon="" icon_at="auto"/> <normal_of_checked icon="" icon_at="auto"/> <over_of_checked icon="" icon_at="auto"/> <pressed bg_image="range_silder_dragger1"/> <pressed_of_checked bg_image="range_silder_dragger1" icon="" icon_at="auto"/> </style> <style name="sonar_icon" bg_color="#363B46" bg_image="" bg_image_draw_type="scale" icon="sonar_btn_home0" icon_at="center" round_radius="5" text_color="#FFFFFF"> <normal font_name="default"/> <disable font_name="default"/> <focused font_name="default"/> <over font_name="default"/> <pressed bg_color="#00C2FF" border_width="0"/> </style> <style name="switch_left_onwa" bg_color="#00C2FF" border="left|top|bottom" border_color="#00FFFF" font_size="25" icon="" round_radius_bottom_left="5" round_radius_top_left="5" text_color="#FFFFFF"> <normal bg_color="#002444" border_color="#416784" round_radius="0" text_color="#416784"/> <disable_of_checked bg_color="#232A35" border_color="#43536A" round_radius="0" text_color="#43536A"/> <focused bg_color="#002444" round_radius="0" text_color="#416784"/> <focused_of_checked border="all"/> <normal_of_checked border_color="#00BBF6"/> <over bg_color="#002444" border_color="#4E7390" round_radius="0" text_color="#416784"/> <over_of_checked border_color="#00C2FF" round_radius="0"/> <pressed_of_checked border="all" border_color="#00BBF6"/> </style> <style name="switch_right_onwa" bg_color="#00C2FF" border="right|top|bottom" border_color="#00C2FF" font_size="25" icon="" round_radius_bottom_left="0" round_radius_bottom_right="5" round_radius_top_left="0" round_radius_top_right="5" text_color="#FFFFFF"> <normal bg_color="#002444" border_color="#416784" round_radius="0" text_color="#416784"/> <disable_of_checked round_radius="0"/> <focused bg_color="#002444" border_color="#00FFFF" round_radius="0" text_color="#416784"/> <focused_of_checked border="all" border_color="#00FFFF"/> <normal_of_checked border_color="#00BBF6"/> <over bg_color="#002444" border_color="#4E7390" round_radius="0" text_color="#416784"/> <over_of_checked round_radius="0"/> <pressed_of_checked border="all" border_color="#00BBF6"/> </style> <style name="tab_onwa" bg_color="#0F395F" border_color="#00FFFF" border_width="1" font_name="Inter_18pt_Regular" font_size="20" margin_left="10" round_radius="5" text_align_h="left" text_color="#FFFFFF"> <normal border_color="#00000000"/> <focused/> <focused_of_checked bg_color="#005585" bg_image="2_1_accuvision_Group_3608" bg_image_draw_type="scale" border="all" icon="" icon_at="auto" margin="0" spacer="0" text_color="#00C2FF"/> <normal_of_checked bg_color="#005585" bg_image="2_1_accuvision_Group_3608" bg_image_draw_type="scale" border="all" border_color="#00558500" border_width="2" icon="" icon_at="auto" margin="0" spacer="0" text_color="#00C2FF"/> <over/> <over_of_checked bg_image="2_1_accuvision_Group_3608" bg_image_draw_type="scale" text_color="#00C2FF"/> </style> <style name="tutorial_tab_btn" bg_color="#002B4B" border_color="#00000000" font_name="Inter_18pt_Regular" font_size="20" margin_left="5" text_align_h="left" text_color="#FFFFFF"> <normal/> <disable_of_checked/> <focused border_color="#00FFFF"/> <focused_of_checked bg_color="#00598B" border_color="#00FFFF"/> <normal_of_checked bg_color="#00598B"/> <over_of_checked/> <pressed bg_color="#00598B"/> <pressed_of_checked bg_color="#00598B"/> </style> <style name="unit_select" font_name="400Inter_Regular" font_size="20" icon="icon_onwa_menu_radio_active" text_color="#FFFFFF"> <normal icon="icon_onwa_menu_radio"/> <focused border_color="#00FFFF" icon="icon_onwa_menu_radio"/> <focused_of_checked border_color="#00FFFF"/> <normal_of_checked/> <over_of_checked/> <pressed_of_checked/> </style> </radio_button> <range_rule_widget> <style name="default"> <normal font_size="32" text_color="#000000"/> </style> </range_rule_widget> <range_slider> <style name="default"> <normal bg_color="#A5A5A5" fg_color="#338FFF" font_size="32" selected_bg_color="#A5A5A5" selected_fg_color="#00B0F0" text_color="#000000"/> </style> <style name="ocean" bg_color="#00C2FF" fg_color="#4C728E" font_size="32" icon="icons_slider_2" selected_bg_color="#00C2FF" selected_fg_color="#4C728E" text_color="#000000"> <normal/> <focused/> </style> <style name="range_slider_default" bg_color="#00C2FF" fg_color="#4C728E" font_size="32" icon="range_slider_dragger0" selected_bg_color="#00C2FF" selected_fg_color="#4C728E" text_color="#000000"> <normal/> <focused/> </style> </range_slider> <scroll_bar_d> <style name="default"> <normal bg_color="#ECECEE"/> </style> </scroll_bar_d> <scroll_bar_m> <style name="default"> <normal bg_color="#ECECEC" fg_color="#919191"/> </style> </scroll_bar_m> <scroll_view> <style name="default"> <normal bg_color="#ECECEC" border_color="#D3D3D3"/> </style> </scroll_view> <setting_slider> <style name="settings" bar_size="6" bg_color="#00C2FF" bg_image="setting_bubble" border_color="#C5E7FF" dragger_size="15" fg_color="#D9D9D9" font_name="default" font_size="18" highlight_font_name="Inter_18pt_Bold" highlight_font_size="18" text_color="#FFFFFF"> <normal/> <activated/> <changed/> <checked/> <checked_of_selected/> <disable/> <disable_of_active/> <disable_of_checked/> <empty/> <empty_focus/> <empty_over/> <error/> <focused border_color="#00FFFF"/> <focused_of_active/> <focused_of_checked/> <normal_of_active/> <normal_of_checked/> <normal_of_selected/> <over/> <over_of_active/> <over_of_checked/> <over_of_selected/> <pressed border_color="#00FFFF"/> <pressed_of_active/> <pressed_of_checked/> <selected/> <unchecked/> <unchecked_of_normal/> </style> </setting_slider> <slide_indicator> <style name="default"> <normal active_icon="" border_color="#00000000" fg_color="#919190" icon="" selected_fg_color="#3B9AFC"/> </style> </slide_indicator> <slide_view> <style name="default"> <has_value has_value="1"/> </style> </slide_view> <slider> <style name="default" bg_color="#D8D8D8" fg_color="#338FFF" icon="rounded_n" round_radius="5"> <normal/> <disable bg_color="#D8D8D866" fg_color="#338FFF66"/> <focused icon="rounded_o"/> <over icon="rounded_o"/> <pressed icon="rounded_p"/> </style> <style name="manual" bg_color="#00C2FF" border_color="#00FFFF" fg_color="#D9D9D9" icon="" round_radius="0"> <normal border_color="#C5E8FF"/> <over/> <pressed/> </style> </slider> <spin_box> <style name="default" bg_color="#FFFFFF" border_color="#0A84FF" border_width="1" margin_left="10" round_radius="5" selected_bg_color="#007BFD" selected_fg_color="#000000" selected_text_color="#FFFFFF" text_align_h="left" text_color="#000000" tips_text_color="#AEAEAF"> <normal border_color="#CBCBCB"/> <disable border_color="#B0B0B0" text_color="#B0B0B0"/> <empty border_color="#CBCBCB" text_color="#AEAEAF"/> <empty_focus text_color="#AEAEAF"/> <empty_over text_color="#AEAEAF"/> <error border_color="#FF0000"/> <focused/> <over/> </style> </spin_box> <switch> <style name="default"> <normal bg_color="#FFFFFF" border_color="#90909090" border_width="1" fg_image="rounded_n" fg_image_draw_type="scale_auto" margin="1" round_radius="11" selected_bg_color="#007AFF"/> </style> </switch> <system_bar> <style name="default"> <normal bg_color="#FFFFFF" border="all" border_color="#F5F5F5" round_radius_top_left="10" round_radius_top_right="10"/> </style> </system_bar> <system_bar_bottom> <style name="default"> <normal bg_color="#FFFFFF" border="top" border_color="#CBCBCB"/> </style> </system_bar_bottom> <tab_button> <style name="default" bg_color="linear-gradient(180deg, #0C80FF 0%, #6AB2FA 100%)" border_color="#54A4FA" border_width="1" text_color="#FFFFFF"> <normal bg_color="#F5F5F5" border_color="#C2C2C2" text_color="#151515"/> <normal_of_active/> <over bg_color="#FFFFFF" border_color="#C1C1C1" text_color="#000000"/> <over_of_active/> <pressed/> <pressed_of_active/> </style> <style name="m_menu_tab_button" font_size="25" margin_left="10" round_radius="5" text_align_h="left"> <normal bg_color="#0F395F" border_color="#00000000" border_width="1" text_color="#FFFFFF"/> <normal_of_active bg_color="#005585" bg_image="2_1_accuvision_Group_3608" bg_image_draw_type="scale" border="all" border_color="#00558500" border_width="2" icon="" icon_at="auto" margin="0" spacer="0" text_color="#00C2FF"/> </style> </tab_button> <tab_button_group> <style name="default"> <has_value has_value="1"/> </style> </tab_button_group> <text_selector> <style name="default"> <normal bg_color="#FFFFFF" bg_image="text_selector" bg_image_draw_type="scale" border_color="#D3D3D3" fg_color="#00000000" highlight_text_color="#FFFFFF" mask_color="#00000000" text_align_h="center" text_color="#000000"/> </style> <style name="dark"> <normal bg_color="#FFFFFF" border_color="#404040" fg_color="#A0A0A0" mask_color="#404040" text_align_h="center" text_color="#000000"/> </style> <style name="page_language"> <normal bg_color="#00000000" bg_image="1_2_language_Rectangle_2481" bg_image_draw_type="center" fg_color="#00000000" font_name="Inter_18pt_Regular" font_size="24" highlight_font_name="Inter_18pt_Regular" highlight_font_size="32" highlight_text_color="#FFFFFF" mask_color="#00000000" text_align_h="center" text_color="#AFD6F2"/> </style> </text_selector> <view> <style name="default"> <normal bg_color="#00000000" border_color="#00000000" round_radius_top_left="6" round_radius_top_right="6"/> </style> <style name="onwa_setting" bg_color="#002C52" round_radius_top_left="0" round_radius_top_right="0"> <normal border_color="#00000000"/> <focused border_color="#00FFFF"/> </style> <style name="setting_col"> <normal bg_color="#002444" border_color="#00000000" round_radius="5"/> </style> </view> <window> <style name="default"> <normal bg_color="#FFFFFF"/> </style> <style name="kp25s_window"> <normal bg_color="#002C54" border_color="#002C5400"/> </style> </window>
键盘页面: home_page.xml
<window name="home_page" style:normal:bg_color="#00000000" on:key_down="if(key=='ESCAPE'){back();}" move_focus_up_key="up" move_focus_down_key="down" move_focus_left_key="left" move_focus_right_key="right"> <view name="view_bottom" x="0" y="60" w="800" h="420" style:normal:bg_color="#002C54" style:normal:round_radius_top_left="0" style:normal:round_radius_top_right="0" style:normal:border_color="#345A77" style:normal:border="top"> <pages name="keyboard_panel" is_keyboard="true" grab_keys="true" style:normal:border_color="#00000000" style:normal:bg_color="#002C54" active="0" x="0" y="0" w="800" h="420" style:focused:border_color="#00000000" style:focused:bg_color="#00000000"> <!-- Lowercase letters panel --> <view name="lowercase_panel" x="0" y="0" w="800" h="420"> <!-- Row 1: 10 keys --> <view name="row" x="20" y="100" w="760" h="60"> <button focusable="true" focused="true" name="key" style="kb_key_onwa" w="65" h="60" x="0" y="0" text="a"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="77" y="0" text="b"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="154" y="0" text="c"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="231" y="0" text="d"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="308" y="0" text="e"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="385" y="0" text="f"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="462" y="0" text="g"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="539" y="0" text="h"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="616" y="0" text="i"/> <button focusable="true" name="key" style="kb_key_onwa" w="65" h="60" x="693" y="0" text="j"/> </view> <!-- Row 2: 10 keys --> <view name="row" x="20" y="182" w="760" h="60"> <button focusable="true" name="key" style="kb_key_onwa" x="0" y="0" w="65" h="60" text="k"/> <button focusable="true" name="key" style="kb_key_onwa" x="77" y="0" w="65" h="60" text="l"/> <button focusable="true" name="key" style="kb_key_onwa" x="154" y="0" w="65" h="60" text="m"/> <button focusable="true" name="key" style="kb_key_onwa" x="231" y="0" w="65" h="60" text="n"/> <button focusable="true" name="key" style="kb_key_onwa" x="308" y="0" w="65" h="60" text="o"/> <button focusable="true" name="key" style="kb_key_onwa" x="385" y="0" w="65" h="60" text="p"/> <button focusable="true" name="key" style="kb_key_onwa" x="462" y="0" w="65" h="60" text="q"/> <button focusable="true" name="key" style="kb_key_onwa" x="539" y="0" w="65" h="60" text="r"/> <button focusable="true" name="key" style="kb_key_onwa" x="616" y="0" w="65" h="60" text="s"/> <button focusable="true" name="key" style="kb_key_onwa" x="693" y="0" w="65" h="60" text="t"/> </view> <!-- Row 3: 8 keys --> <view name="row" x="20" y="264" w="760" h="60"> <button focusable="true" name="uppercase_key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="⇧"/> <button focusable="true" name="key" style="kb_key_onwa" x="155" y="0" w="65" h="60" text="u"/> <button focusable="true" name="key" style="kb_key_onwa" x="232" y="0" w="65" h="60" text="v"/> <button focusable="true" name="key" style="kb_key_onwa" x="309" y="0" w="65" h="60" text="w"/> <button focusable="true" name="key" style="kb_key_onwa" x="386" y="0" w="65" h="60" text="x"/> <button focusable="true" name="key" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="y"/> <button focusable="true" name="key" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="z"/> <button focusable="true" name="key:backspace" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="⌫"/> </view> <!-- Row 4: 5 keys --> <view name="row" x="20" y="346" w="760" h="60"> <button focusable="true" name="number_mode_key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="123"/> <button focusable="true" name="space" style="kb_key_onwa" x="155" y="0" w="296" h="60" text="Space"/> <button focusable="true" name="key:left" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="←"/> <button focusable="true" name="key:right" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="→"/> <button focusable="true" name="action" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="Done"/> </view> <button focusable="true" name="key:clear" style="kb_key_onwa" x="670" y="21" w="115" h="49" text="Clear"/> </view> <!-- Uppercase letters panel --> <view name="uppercase_panel" x="0" y="0" w="800" h="420"> <!-- Row 1: 10 keys --> <view x="20" y="100" w="760" h="60" name="row"> <button focusable="true" focused="true" name="key" style="kb_key_onwa" x="0" y="0" w="65" h="60" text="A"/> <button focusable="true" name="key" style="kb_key_onwa" x="77" y="0" w="65" h="60" text="B"/> <button focusable="true" name="key" style="kb_key_onwa" x="154" y="0" w="65" h="60" text="C"/> <button focusable="true" name="key" style="kb_key_onwa" x="231" y="0" w="65" h="60" text="D"/> <button focusable="true" name="key" style="kb_key_onwa" x="308" y="0" w="65" h="60" text="E"/> <button focusable="true" name="key" style="kb_key_onwa" x="385" y="0" w="65" h="60" text="F"/> <button focusable="true" name="key" style="kb_key_onwa" x="462" y="0" w="65" h="60" text="G"/> <button focusable="true" name="key" style="kb_key_onwa" x="539" y="0" w="65" h="60" text="H"/> <button focusable="true" name="key" style="kb_key_onwa" x="616" y="0" w="65" h="60" text="I"/> <button focusable="true" name="key" style="kb_key_onwa" x="693" y="0" w="65" h="60" text="J"/> </view> <!-- Row 2: 10 keys --> <view x="20" y="182" w="760" h="60" name="row"> <button focusable="true" name="key" style="kb_key_onwa" x="0" y="0" w="65" h="60" text="K"/> <button focusable="true" name="key" style="kb_key_onwa" x="77" y="0" w="65" h="60" text="L"/> <button focusable="true" name="key" style="kb_key_onwa" x="154" y="0" w="65" h="60" text="M"/> <button focusable="true" name="key" style="kb_key_onwa" x="231" y="0" w="65" h="60" text="N"/> <button focusable="true" name="key" style="kb_key_onwa" x="308" y="0" w="65" h="60" text="O"/> <button focusable="true" name="key" style="kb_key_onwa" x="385" y="0" w="65" h="60" text="P"/> <button focusable="true" name="key" style="kb_key_onwa" x="462" y="0" w="65" h="60" text="Q"/> <button focusable="true" name="key" style="kb_key_onwa" x="539" y="0" w="65" h="60" text="R"/> <button focusable="true" name="key" style="kb_key_onwa" x="616" y="0" w="65" h="60" text="S"/> <button focusable="true" name="key" style="kb_key_onwa" x="693" y="0" w="65" h="60" text="T"/> </view> <!-- Row 3: 8 keys --> <view x="20" y="264" w="760" h="60" name="row"> <button focusable="true" name="lowercase_key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="⇧"/> <button focusable="true" name="key" style="kb_key_onwa" x="155" y="0" w="65" h="60" text="U"/> <button focusable="true" name="key" style="kb_key_onwa" x="232" y="0" w="65" h="60" text="V"/> <button focusable="true" name="key" style="kb_key_onwa" x="309" y="0" w="65" h="60" text="W"/> <button focusable="true" name="key" style="kb_key_onwa" x="386" y="0" w="65" h="60" text="X"/> <button focusable="true" name="key" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="Y"/> <button focusable="true" name="key" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="Z"/> <button focusable="true" name="key:backspace" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="⌫"/> </view> <!-- Row 4: 5 keys --> <view x="20" y="346" w="760" h="60" name="row"> <button focusable="true" name="number_mode_key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="123"/> <button focusable="true" name="space" style="kb_key_onwa" x="155" y="0" w="296" h="60" text="Space"/> <button focusable="true" name="key:left" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="←"/> <button focusable="true" name="key:right" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="→"/> <button focusable="true" name="action" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="Done"/> </view> <button focusable="true" name="key:clear" style="kb_key_onwa" x="r:15" y="21" w="115" h="49" text="Clear"/> </view> <!-- Number panel --> <view name="number_panel" x="0" y="0" w="800" h="420"> <!-- Row 1: 1-0 --> <view name="row" x="20" y="100" w="760" h="60"> <button focusable="true" focused="true" name="key" style="kb_key_onwa" x="0" y="0" w="65" h="60" text="1"/> <button focusable="true" name="key" style="kb_key_onwa" x="77" y="0" w="65" h="60" text="2"/> <button focusable="true" name="key" style="kb_key_onwa" x="154" y="0" w="65" h="60" text="3"/> <button focusable="true" name="key" style="kb_key_onwa" x="231" y="0" w="65" h="60" text="4"/> <button focusable="true" name="key" style="kb_key_onwa" x="308" y="0" w="65" h="60" text="5"/> <button focusable="true" name="key" style="kb_key_onwa" x="385" y="0" w="65" h="60" text="6"/> <button focusable="true" name="key" style="kb_key_onwa" x="462" y="0" w="65" h="60" text="7"/> <button focusable="true" name="key" style="kb_key_onwa" x="539" y="0" w="65" h="60" text="8"/> <button focusable="true" name="key" style="kb_key_onwa" x="616" y="0" w="65" h="60" text="9"/> <button focusable="true" name="key" style="kb_key_onwa" x="693" y="0" w="65" h="60" text="0"/> </view> <!-- Row 2: Special characters --> <view name="row" x="20" y="182" w="760" h="60"> <button focusable="true" name="key" style="kb_key_onwa" x="0" y="0" w="65" h="60" text="\\"/> <button focusable="true" name="key" style="kb_key_onwa" x="77" y="0" w="65" h="60" text="/"/> <button focusable="true" name="key" style="kb_key_onwa" x="154" y="0" w="65" h="60" text=":"/> <button focusable="true" name="key" style="kb_key_onwa" x="231" y="0" w="65" h="60" text=";"/> <button focusable="true" name="key" style="kb_key_onwa" x="308" y="0" w="65" h="60" text="("/> <button focusable="true" name="key" style="kb_key_onwa" x="385" y="0" w="65" h="60" text=")"/> <button focusable="true" name="key" style="kb_key_onwa" x="462" y="0" w="65" h="60" text="+"/> <button focusable="true" name="key" style="kb_key_onwa" x="539" y="0" w="65" h="60" text="-"/> <button focusable="true" name="key" style="kb_key_onwa" x="616" y="0" w="65" h="60" text="="/> <button focusable="true" name="&" style="kb_key_onwa" x="693" y="0" w="65" h="60" text="&"/> </view> <!-- Row 3: More special characters --> <view name="row" x="20" y="264" w="760" h="60"> <button focusable="true" name="key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="@"/> <button focusable="true" name="key" style="kb_key_onwa" x="155" y="0" w="65" h="60" text="."/> <button focusable="true" name="key" style="kb_key_onwa" x="232" y="0" w="65" h="60" text=","/> <button focusable="true" name="key" style="kb_key_onwa" x="309" y="0" w="65" h="60" text="?"/> <button focusable="true" name="key" style="kb_key_onwa" x="386" y="0" w="65" h="60" text="!"/> <button focusable="true" name="key" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="'"/> <button focusable="true" name="key" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="_"/> <button focusable="true" name="key:backspace" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="⌫"/> </view> <!-- Row 4: ABC, space, navigation, done --> <view name="row" x="20" y="346" w="760" h="60"> <button focusable="true" name="alphabet_key" style="kb_key_onwa" x="0" y="0" w="144" h="60" text="ABC"/> <button focusable="true" name="space" style="kb_key_onwa" x="155" y="0" w="296" h="60" text="Space"/> <button focusable="true" name="key:left" style="kb_key_onwa" x="463" y="0" w="65" h="60" text="←"/> <button focusable="true" name="key:right" style="kb_key_onwa" x="540" y="0" w="65" h="60" text="→"/> <button focusable="true" name="action" style="kb_key_onwa" x="616" y="0" w="140" h="60" text="Done"/> </view> <button focusable="true" name="key:clear" style="kb_key_onwa" x="r:15" y="21" w="115" h="49" text="Clear"/> </view> </pages> <edit name="edit_name" x="19" y="33" w="640" h="43" style="kb_onwa" focused="true" input_type="custom" tips="custom"/> </view> </window>
键盘逻辑: home_page.c
#include "awtk.h" #include "../common/navigator.h" #include "widgets/edit.h" // 键盘面板索引 typedef enum { KEYBOARD_PANEL_LOWERCASE = 0, // 小写字母面板 KEYBOARD_PANEL_UPPERCASE = 1, // 大写字母面板 KEYBOARD_PANEL_NUMBER = 2, // 数字面板 } keyboard_panel_t; int g_last_alphabet_page_value = KEYBOARD_PANEL_LOWERCASE; /** * 发送按键字符 */ static ret_t on_send_key(void* ctx, event_t* e) { widget_t* button = WIDGET(e->target); char text[2]; text[0] = (char)button->text.str[0]; text[1] = '\0'; printf("text: %s\n", text); input_method_commit_text(input_method(), text); return RET_OK; } /** * 退格键处理 */ static ret_t on_backspace(void* ctx, event_t* e) { input_method_dispatch_key(input_method(), TK_KEY_BACKSPACE); return RET_OK; } /** * 空格键处理 */ static ret_t on_space(void* ctx, event_t* e) { input_method_commit_text(input_method(), " "); return RET_OK; } /** * 左箭头键处理 */ static ret_t on_key_left(void* ctx, event_t* e) { input_method_dispatch_key(input_method(), TK_KEY_LEFT); return RET_OK; } /** * 右箭头键处理 */ static ret_t on_key_right(void* ctx, event_t* e) { input_method_dispatch_key(input_method(), TK_KEY_RIGHT); return RET_OK; } /** * 清除按钮处理 */ static ret_t on_clear(void* ctx, event_t* e) { widget_t* win = WIDGET(ctx); widget_t* edit = widget_lookup(win, "edit_name", TRUE); if (edit != NULL) { widget_set_text_utf8(edit, ""); } return RET_OK; } /** * Shift键处理 - 切换到大写面板 */ static ret_t on_shift_uppercase(void* ctx, event_t* e) { widget_t* win = WIDGET(ctx); widget_t* pages = widget_lookup(win, "keyboard_panel", TRUE); if (pages != NULL) { widget_set_value(pages, KEYBOARD_PANEL_UPPERCASE); /* save if number panel back to alphabet panel */ g_last_alphabet_page_value = KEYBOARD_PANEL_UPPERCASE; /* set focused to lowercase key */ widget_t* lowercase_key = widget_lookup(win, "lowercase_key", TRUE); widget_set_focused(lowercase_key, TRUE); } return RET_OK; } /** * Shift关闭键处理 - 切换回小写面板 */ static ret_t on_shift_lowercase(void* ctx, event_t* e) { widget_t* win = WIDGET(ctx); widget_t* pages = widget_lookup(win, "keyboard_panel", TRUE); if (pages != NULL) { widget_set_value(pages, KEYBOARD_PANEL_LOWERCASE); /* save if number panel back to alphabet panel */ g_last_alphabet_page_value = KEYBOARD_PANEL_LOWERCASE; /* set focused to uppercase key */ widget_t* uppercase_key = widget_lookup(win, "uppercase_key", TRUE); widget_set_focused(uppercase_key, TRUE); } return RET_OK; } /** * 数字模式键处理 - 切换到数字面板 */ static ret_t on_number_mode(void* ctx, event_t* e) { widget_t* win = WIDGET(ctx); widget_t* pages = widget_lookup(win, "keyboard_panel", TRUE); if (pages != NULL) { widget_set_value(pages, KEYBOARD_PANEL_NUMBER); /* set focused to ABC key */ widget_t* alphabet_key = widget_lookup(win, "alphabet_key", TRUE); widget_set_focused(alphabet_key, TRUE); } return RET_OK; } /** * 返回上一个字母面板 */ static ret_t back_to_previous_alphabet_panel(void* ctx, event_t* e) { widget_t* win = WIDGET(ctx); widget_t* pages = widget_lookup(win, "keyboard_panel", TRUE); if (pages != NULL) { widget_set_value(pages, g_last_alphabet_page_value); /* set focused to 123 key */ widget_t* number_mode_key = widget_lookup(win, "number_mode_key", TRUE); widget_set_focused(number_mode_key, TRUE); } return RET_OK; } /* 键盘完成输入处理 */ static ret_t on_action_click(void* ctx, event_t* e) { pointer_event_t* evt = pointer_event_cast(e); // TODO: 在此添加控件事件处理程序代码 navigator_back_to_home(); return RET_OK; } /** * 初始化窗口的子控件 */ static ret_t visit_init_child(void* ctx, const void* iter) { widget_t* win = WIDGET(ctx); widget_t* widget = WIDGET(iter); const char* name = widget->name; // 初始化指定名称的控件(设置属性或注册事件),请保证控件名称在窗口上唯一 if (name != NULL && *name != '\0') { if (tk_str_eq(name, "key")) { widget_on(widget, EVT_CLICK, on_send_key, win); } else if (tk_str_eq(name, "key:backspace")) { widget_on(widget, EVT_CLICK, on_backspace, win); } else if (tk_str_eq(name, "space")) { widget_on(widget, EVT_CLICK, on_space, win); /* 左右移动光标位置 */ } else if (tk_str_eq(name, "key:left")) { widget_on(widget, EVT_CLICK, on_key_left, win); } else if (tk_str_eq(name, "key:right")) { widget_on(widget, EVT_CLICK, on_key_right, win); } else if (tk_str_eq(name, "key:clear")) { widget_on(widget, EVT_CLICK, on_clear, win); } else if (tk_str_eq(name, "uppercase_key")) { widget_on(widget, EVT_CLICK, on_shift_uppercase, win); } else if (tk_str_eq(name, "lowercase_key")) { widget_on(widget, EVT_CLICK, on_shift_lowercase, win); } else if (tk_str_eq(name, "alphabet_key")) { widget_on(widget, EVT_CLICK, back_to_previous_alphabet_panel, win); } else if (tk_str_eq(name, "number_mode_key")) { widget_on(widget, EVT_CLICK, on_number_mode, win); } else if (tk_str_eq(name, "action")) { widget_on(widget, EVT_CLICK, on_action_click, win); } } return RET_OK; } /** * 初始化窗口 */ ret_t home_page_init(widget_t* win, void* ctx) { (void)ctx; return_value_if_fail(win != NULL, RET_BAD_PARAMS); widget_foreach(win, visit_init_child, win); return RET_OK; }
The text was updated successfully, but these errors were encountered:
切换界面后焦点是停留在哪里呢?
Sorry, something went wrong.
No branches or pull requests
根据7.6 自定义键盘的做法实现了一个键盘页面。
实现思路是大写键盘,小写键盘,数字键盘各自分了一个page来实现大小写和输入数字,但是发现切换page的时候焦点只有实际程序焦点的切换,但是焦点样式却没有跟着过来,鼠标移动到这个按钮的时候才会刷新成正常的样式。
我试了下在按键事件里面widget_set_focused和在idle_queue函数里面widget_set_focused都没有用,这个有没有解决的方法?
谢谢。
键盘样式:
default.xml
键盘页面:
home_page.xml
键盘逻辑:
home_page.c
The text was updated successfully, but these errors were encountered: