Hi,
I'm developing an embedded Qt application where the only input method will be using the touchscreen and have made a virtual keyboard mapped with QSignalMapper. When a user presses (touches, clicks) a button on the virtual keyboard I would like the same behaviour as if a real keyboard was used. How do I do that? I figure it should be something like:
void Widget::keySelected (const QString& key) {
int i = key.at(0).toAscii();
}
void Widget::keySelected (const QString& key) {
int i = key.at(0).toAscii();
QKeyEvent::QKeyEvent ( QEvent::KeyPress, i, Qt::NoModifier, key, false, 1);
}
To copy to clipboard, switch view to plain text mode
But that doesn't work.
The following code:
void Widget::keySelected (const QString& key) {
qDebug() << key;
}
void Widget::keySelected (const QString& key) {
qDebug() << key;
}
To copy to clipboard, switch view to plain text mode
gives the output of the keyvalue, e.g. "A" if the A-button is pressed.
Would be greatful if someone has a hint here
Bookmarks