이 페이지에서

Qt3DInput::QKeyEvent Class

class Qt3DInput::QKeyEvent

KeyBoardHandler에서 전송된 QKeyEvent 이벤트 유형. 더 보기...

헤더: #include <QKeyEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
QML에서: KeyEvent
상속: QObject
상태: 사용 중단됨

이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 말 것을 강력히 권장합니다.

속성

공개 행사

int count() const
bool isAccepted() const
bool isAutoRepeat() const
int key() const
bool matches(QKeySequence::StandardKey key_) const
int modifiers() const
quint32 nativeScanCode() const
void setAccepted(bool accepted)
QString text() const
QEvent::Type type() const

상세 설명

속성 문서

accepted : bool

'accepted' 속성을 ' true '로 설정하면 키 이벤트가 해당 항목의 상위 항목으로 전파되는 것을 방지할 수 있습니다.

일반적으로, 항목이 키 이벤트에 반응하는 경우, 상위 항목들이 동일한 이벤트에 반응하지 않도록 해당 이벤트를 수락해야 합니다.

액세스 함수:

bool isAccepted() const
void setAccepted(bool accepted)

[read-only] count : const int

이 이벤트에 관련된 키의 개수를 저장합니다. ` text `가 비어 있지 않은 경우, 이는 단순히 문자열의 길이를 나타냅니다.

액세스 함수:

int count() const

[read-only] isAutoRepeat : const bool

이 이벤트가 자동 반복 키에서 발생한 것인지 여부를 나타냅니다.

액세스 함수:

bool isAutoRepeat() const

[read-only] key : const int

이 속성은 눌리거나 놓인 키의 코드를 저장합니다.

키보드 코드 목록은 Qt.Key 을 참조하십시오.

QKeyEvent::key()도 참조하십시오.

액세스 함수:

int key() const

[read-only] modifiers : const int

이 속성은 이벤트가 발생하기 직전에 존재했던 키보드 수정자 플래그를 포함합니다.

QKeyEvent::modifiers()도 참조하십시오.

액세스 함수:

int modifiers() const

[read-only] nativeScanCode : const quint32

이 속성에는 눌린 키의 네이티브 스캔 코드가 포함됩니다. 이 값은 QKeyEvent 에서 변경 없이 전달됩니다.

액세스 함수:

quint32 nativeScanCode() const

[read-only] text : const QString

이 속성은 키가 생성한 유니코드 텍스트를 저장합니다. Shift, Control, Alt, Meta와 같은 수정 키가 눌리거나 풀리는 경우, 반환되는 텍스트는 빈 문자열일 수 있습니다. 이러한 경우 key 에는 유효한 값이 포함됩니다.

액세스 함수:

QString text() const

멤버 함수 문서

[invokable] bool QKeyEvent::matches(QKeySequence::StandardKey key_) const

키 이벤트가 주어진 표준 키 key_ 와 일치하면 ` true `를 반환하고, 그렇지 않으면 ` false`를 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.

QKeySequence::StandardKey도 참조하십시오 .

QEvent::Type QKeyEvent::type() const

이벤트의 유형을 반환합니다.

관련 비회원

QKeyEventPtr

QKeyEvent 에 대한 공유 포인터입니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.