Shortcut setting in Webclient UI

280 阅读1分钟

Created by Jerry Wang, last modified on Dec 08, 2014

webclient ui能够支持end user为特定的动作设定键盘shortcut:
clipboard1
如上例子所示,focus 自动聚焦到navigation bar上的键盘shortcut是Alt+Ctrl+W:
clipboard2
shortcut设置通过cl_thtmlb_personalization 读取并存储在internal table LT_SHORTCUTS:
clipboard3
系统将key G转换成Javascript需要使用的key code 71:
clipboard4
clipboard5

最后动态生成对应的javascript code:
clipboard6

thtmlbKeyboardShortcuts[0] = new Object();thtmlbKeyboardShortcuts[0].alt =true;thtmlbKeyboardShortcuts[0].ctrl =true;thtmlbKeyboardShortcuts[0].shift =false;thtmlbKeyboardShortcuts[0].esc =false;thtmlbKeyboardShortcuts[0].keycode =71;thtmlbKeyboardShortcuts[0].func =thtmlbSetFocus;thtmlbKeyboardShortcuts[0].params = "FOCUS01";

在UI上做测试: 将focus 设置在其他控件上,然后点Alt+Ctrl+W, focus自动返回到navigation bar上:
image

clipboard8