Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_kernel_qabstractnativeeventfilter.mm
Go to the documentation of this file.
1// Copyright (C) 2016 Samuel Gaist <samuel.gaist@edeltech.ch>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5#include "mycocoaeventfilter.h"
6
7#import <AppKit/AppKit.h>
8
10{
11 if (eventType == "mac_generic_NSEvent") {
12 NSEvent *event = static_cast<NSEvent *>(message);
13 if ([event type] == NSKeyDown) {
14 // Handle key event
15 qDebug() << QString::fromNSString([event characters]);
16 }
17 }
18 return false;
19}
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override
[0]
\inmodule QtCore
Definition qbytearray.h:57
#define qDebug
[1]
Definition qlogging.h:164
GLenum type
GLuint GLsizei const GLchar * message
struct _cl_event * event
ptrdiff_t qintptr
Definition qtypes.h:166
QList< QChar > characters