void MiniBrowser::handleKeyReleaseEvent(const XKeyReleasedEvent& event) { if (!m_view) return; bool shouldUseUpperCase; KeySym symbol = chooseSymbolForXKeyEvent(event, &shouldUseUpperCase); if (checkNavigationCommand(symbol, event.state) != NoNavigation) return; NIXKeyEvent nixEvent = convertXKeyEventToNixKeyEvent(event, symbol, shouldUseUpperCase); if (m_touchMocker && m_touchMocker->handleKeyRelease(nixEvent)) { scheduleUpdateDisplay(); return; } NIXViewSendKeyEvent(m_view, &nixEvent); }
void MiniBrowser::handleKeyPressEvent(const XKeyPressedEvent& event) { if (!m_view) return; bool shouldUseUpperCase; KeySym symbol = chooseSymbolForXKeyEvent(event, &shouldUseUpperCase); NavigationCommand command = checkNavigationCommand(symbol, event.state); switch (command) { case BackNavigation: WKPageGoBack(pageRef()); return; case ForwardNavigation: WKPageGoForward(pageRef()); return; case ReloadNavigation: WKPageReload(pageRef()); return; default: NIXKeyEvent nixEvent = convertXKeyEventToNixKeyEvent(event, symbol, shouldUseUpperCase); NIXViewSendKeyEvent(m_view, &nixEvent); } }
void Tab::sendKeyEvent(NIXKeyEvent* event) { NIXViewSendKeyEvent(m_view, event); }