Add up and down direction to the key detection

This commit is contained in:
jfmcarreira committed 2015-09-24 21:36:03 +01:00
1 parent 40b19ec6d9
commit e81d2d2f38
2 files changed
+9 -1

No files matched your search

+7 -1
View File
@@ -203,7 +203,7 @@ VideoSubWindow::~VideoSubWindow()
Void VideoSubWindow::keyPressEvent( QKeyEvent* event )
{
if( checkCategory( MODULE_SUBWINDOW ) && m_pcCurrentDisplayModule )
if( m_pcCurrentDisplayModule )
{
if( m_pcCurrentDisplayModule->getModuleRequirements() & MODULE_USES_KEYS )
{
@@ -216,6 +216,12 @@ Void VideoSubWindow::keyPressEvent( QKeyEvent* event )
case Qt::Key_D:
bRet = m_pcCurrentDisplayModule->getModule()->keyPressed( MODULE_KEY_RIGHT );
break;
case Qt::Key_W:
bRet = m_pcCurrentDisplayModule->getModule()->keyPressed( MODULE_KEY_UP );
break;
case Qt::Key_S:
bRet = m_pcCurrentDisplayModule->getModule()->keyPressed( MODULE_KEY_DOWN );
break;
}
if( bRet )
{
+2
View File
@@ -87,6 +87,8 @@ enum Module_Key_Supported
{
MODULE_KEY_LEFT,
MODULE_KEY_RIGHT,
MODULE_KEY_UP,
MODULE_KEY_DOWN,
};