qskIsStandardKeyInput added
This commit is contained in:
parent
d7d5c8cff3
commit
36c759dc41
@ -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;
|
||||||
|
@ -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 );
|
||||||
|
@ -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
|
||||||
|
@ -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();
|
||||||
|
@ -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 ???
|
||||||
|
|
||||||
|
@ -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 ???
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user