1,早期版本 的键盘控制可以通过以下API实现
/webcore/khtml/Khtmlview.h
class KHTMLView : public QScrollView
KHTMLView::keyPressEvent
// Move to the next focusable node according to the direction indicated.
// 4 directions: DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN
// There's no structure to hold node order in each direction. And we can't
// presume a pre-decidable order for every page.
// The algorithm compares all the node to get the closer one in the indicated
// direction basically.
bool KHTMLView::focusMoveToNode(Direction dir)
2,可以对其进行了封装
将khtmlview作为 KWQKHTMLPart 的一个成员,从而实现part对view的控制
本文介绍了一个早期版本浏览器中用于键盘导航的API实现方法。通过KHTMLView类中的focusMoveToNode函数,可以根据方向参数(DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN)在网页元素间进行焦点移动。此功能未预先定义节点顺序,而是通过比较所有节点来确定最接近的方向位置。
22

被折叠的 条评论
为什么被折叠?



