keyboard: Make key buttons work
Not sure whether this is the right way...
This commit is contained in:
parent
ddea04445c
commit
60c16c82c8
@ -258,8 +258,11 @@ void QskInputCompositionModel::moveCursor( Qt::Key key )
|
||||
if ( !m_data->preedit.isEmpty() )
|
||||
return;
|
||||
|
||||
// ### this should be in the panel:
|
||||
QKeyEvent moveCursorPress( QEvent::KeyPress, key, Qt::NoModifier );
|
||||
QKeyEvent moveCursorRelease( QEvent::KeyRelease, key, Qt::NoModifier );
|
||||
QFocusEvent focusIn( QEvent::FocusIn ); // hack to display the cursor
|
||||
QCoreApplication::sendEvent( m_data->inputItem, &focusIn );
|
||||
QCoreApplication::sendEvent( m_data->inputItem, &moveCursorPress );
|
||||
QCoreApplication::sendEvent( m_data->inputItem, &moveCursorRelease );
|
||||
}
|
||||
|
@ -160,6 +160,8 @@ QskKeyButton::QskKeyButton( int keyIndex, QskInputPanel* inputPanel, QQuickItem*
|
||||
options.setFontSizeMode( QskTextOptions::VerticalFit );
|
||||
setTextOptions( options );
|
||||
|
||||
setFocusPolicy( Qt::TabFocus );
|
||||
|
||||
auto keyData = m_inputPanel->keyDataAt( m_keyIndex );
|
||||
const auto key = keyData.key & ~KeyStates;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user