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 ( event->key() == Qt::Key_Up ||
qskKeyMatches( event, QKeySequence::MoveToNextChar ) )
qskIsStandardKeyInput( event, QKeySequence::MoveToNextChar ) )
{
increment( m_stepSize );
return;
}
if ( event->key() == Qt::Key_Down ||
qskKeyMatches( event, QKeySequence::MoveToPreviousChar ) )
qskIsStandardKeyInput( event, QKeySequence::MoveToPreviousChar ) )
{
increment( -m_stepSize );
return;

View File

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

View File

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

View File

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

View File

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

View File

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