QKeyEvent Class

class Qt3DInput::QKeyEvent

키보드핸들러가 보내는 QKeyEvent 이벤트 유형입니다. 더 보기...

헤더: #include <QKeyEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
QML에서: KeyEvent
상속합니다: QObject
상태: Deprecated

속성

공공 기능

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

수락을 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

이 속성에는 키가 생성한 유니코드 텍스트가 저장됩니다. 시프트, 컨트롤, Alt, 메타 등의 수정자 키를 누르거나 놓는 경우 반환되는 텍스트는 빈 문자열일 수 있습니다. 이러한 경우 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 에 대한 공유 포인터입니다.

© 2025 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.