[directfb] Implement grab/ungrab of keyboard/pointer

Change-Id: Ie2b99bb659e324c63bfd23e96d6c89c13a8df3b4
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-10-18 15:10:23 +02:00 committed by Qt by Nokia
parent 960502d91a
commit c7df1af337
2 changed files with 26 additions and 0 deletions

View File

@ -169,3 +169,27 @@ WId QDirectFbWindow::winId() const
m_dfbWindow->GetID(m_dfbWindow.data(), &id);
return WId(id);
}
bool QDirectFbWindow::setKeyboardGrabEnabled(bool grab)
{
DFBResult res;
if (grab)
res = m_dfbWindow->GrabKeyboard(m_dfbWindow.data());
else
res = m_dfbWindow->UngrabKeyboard(m_dfbWindow.data());
return res == DFB_OK;
}
bool QDirectFbWindow::setMouseGrabEnabled(bool grab)
{
DFBResult res;
if (grab)
res = m_dfbWindow->GrabPointer(m_dfbWindow.data());
else
res = m_dfbWindow->UngrabPointer(m_dfbWindow.data());
return res == DFB_OK;
}

View File

@ -61,6 +61,8 @@ public:
void setVisible(bool visible);
Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
bool setKeyboardGrabEnabled(bool grab);
bool setMouseGrabEnabled(bool grab);
void raise();
void lower();
WId winId() const;