Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Qt 通过 QGuiApplication::keyboardModifiers()提供了这一点。QML 方式是什么?
在QMLKeyEvent中存在具有名为. 它包含可用修饰符的按位组合。modifers
KeyEvent
modifers
它遵循直接取自上述文档的示例:
Item { focus: true Keys.onPressed: { if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier)) doSomething(); } }
有关可用修饰符的完整列表,请参阅官方文档。