qskIsStandardKeyInput added

This commit is contained in:
Uwe Rathmann 2022-03-11 14:24:10 +01:00
parent d7d5c8cff3
commit 36c759dc41
6 changed files with 8 additions and 8 deletions

View File

@ -182,14 +182,14 @@ void QskBoundedInput::keyPressEvent( QKeyEvent* event )
if ( !isReadOnly() ) if ( !isReadOnly() )
{ {
if ( event->key() == Qt::Key_Up || if ( event->key() == Qt::Key_Up ||
qskKeyMatches( event, QKeySequence::MoveToNextChar ) ) qskIsStandardKeyInput( event, QKeySequence::MoveToNextChar ) )
{ {
increment( m_stepSize ); increment( m_stepSize );
return; return;
} }
if ( event->key() == Qt::Key_Down || if ( event->key() == Qt::Key_Down ||
qskKeyMatches( event, QKeySequence::MoveToPreviousChar ) ) qskIsStandardKeyInput( event, QKeySequence::MoveToPreviousChar ) )
{ {
increment( -m_stepSize ); increment( -m_stepSize );
return; return;

View File

@ -114,7 +114,7 @@ qreal qskWheelIncrement( const QWheelEvent* event )
#endif #endif
bool qskKeyMatches( const QKeyEvent* event, QKeySequence::StandardKey key ) bool qskIsStandardKeyInput( const QKeyEvent* event, QKeySequence::StandardKey key )
{ {
#if 1 #if 1
return event->matches( key ); return event->matches( key );

View File

@ -150,6 +150,6 @@ QSK_EXPORT qreal qskWheelIncrement( const QWheelEvent* );
#endif #endif
QSK_EXPORT bool qskKeyMatches( const QKeyEvent*, QKeySequence::StandardKey ); QSK_EXPORT bool qskIsStandardKeyInput( const QKeyEvent*, QKeySequence::StandardKey );
#endif #endif

View File

@ -15,10 +15,10 @@ QSK_SYSTEM_STATE( QskPageIndicator, Selected, QskAspect::FirstSystemState << 1 )
static int qskKeyIncrement( static int qskKeyIncrement(
const QskPageIndicator* indicator, const QKeyEvent* event ) const QskPageIndicator* indicator, const QKeyEvent* event )
{ {
if ( qskKeyMatches( event, QKeySequence::MoveToNextChar ) ) if ( qskIsStandardKeyInput( event, QKeySequence::MoveToNextChar ) )
return 1; return 1;
if ( qskKeyMatches( event, QKeySequence::MoveToPreviousChar ) ) if ( qskIsStandardKeyInput( event, QKeySequence::MoveToPreviousChar ) )
return -1; return -1;
const auto key = event->key(); const auto key = event->key();

View File

@ -281,7 +281,7 @@ void QskDialogSubWindow::keyPressEvent( QKeyEvent* event )
button->click(); button->click();
} }
if ( qskKeyMatches( event, QKeySequence::Cancel ) ) if ( qskIsStandardKeyInput( event, QKeySequence::Cancel ) )
{ {
// using shortcuts instead ??? // using shortcuts instead ???

View File

@ -249,7 +249,7 @@ void QskDialogWindow::keyPressEvent( QKeyEvent* event )
button->click(); button->click();
} }
if ( qskKeyMatches( event, QKeySequence::Cancel ) ) if ( qskIsStandardKeyInput( event, QKeySequence::Cancel ) )
{ {
// using shortcuts instead ??? // using shortcuts instead ???