5#include <QtGui/qtguiglobal.h>
11#include <qpa/qwindowsysteminterface.h>
15#include <QGuiApplication>
33 void updateSelection(
int selStart,
int selEnd,
int candidatesStart,
int candidatesEnd)
35 qCDebug(lcQpaInputMethods) <<
">>> UPDATESELECTION" << selStart << selEnd << candidatesStart << candidatesEnd;
48 "showSoftwareKeyboard",
61 QJniObject::callStaticMethod<void>(
applicationClass(),
"resetSoftwareKeyboard");
62 qCDebug(lcQpaInputMethods) <<
"@@@ RESETSOFTWAREKEYBOARD";
67 QJniObject::callStaticMethod<void>(
applicationClass(),
"hideSoftwareKeyboard");
68 qCDebug(lcQpaInputMethods) <<
"@@@ HIDESOFTWAREKEYBOARD";
73 return QJniObject::callStaticMethod<jboolean>(
applicationClass(),
"isSoftwareKeyboardVisible");
83 return QJniObject::callStaticMethod<jint>(
applicationClass(),
"getSelectHandleWidth");
88 QJniObject::callStaticMethod<void>(
applicationClass(),
"updateHandles",
"(IIIIIIIIZ)V",
89 mode, editMenuPos.
x(), editMenuPos.
y(), editButtons,
91 anchor.
x(), anchor.
y(), rtl);
94 static void mouseDown(JNIEnv *, jobject , jint , jint
x, jint
y)
102 QPoint localPos = tlw ? (globalPos - tlw->position()) : globalPos;
108 static void mouseUp(JNIEnv *, jobject , jint , jint
x, jint
y)
114 QPoint localPos = tlw ? (globalPos -tlw->position()) : globalPos;
132 QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
138 static void mouseWheel(JNIEnv *, jobject , jint , jint
x, jint
y, jfloat hdelta, jfloat vdelta)
147 QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
148 QPoint angleDelta(hdelta * 120, vdelta * 120);
165 if (!rightMouseFromLongPress)
170 QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
188 static void touchAdd(JNIEnv *, jobject , jint , jint
id, jint action, jboolean , jint
x, jint
y,
189 jfloat major, jfloat minor, jfloat rotation, jfloat pressure)
231 if (!platformIntegration)
251 static void touchEnd(JNIEnv * , jobject , jint , jint )
281#if QT_CONFIG(tabletevent)
288 static void tabletEvent(JNIEnv *, jobject , jint , jint deviceId, jlong
time, jint action,
289 jint
pointerType, jint buttonState, jfloat
x, jfloat
y, jfloat pressure)
291#if QT_CONFIG(tabletevent)
295 QPointF localPos = tlw ? (globalPosF - tlw->position()) : globalPosF;
319 if (buttonState == 0)
322 buttons = Qt::MouseButtons(buttonState);
326 qCDebug(lcQpaInputMethods) << action <<
pointerType << buttonState <<
'@' <<
x <<
y <<
"pressure" << pressure <<
": buttons" << buttons;
337 if (
key >= 0x00000007 &&
key <= 0x00000010)
341 if (
key >= 0x0000001d &&
key <= 0x00000036)
345 if (
key >= 0x00000083 &&
key <= 0x0000008e)
349 if (
key >= 0x00000090 &&
key <= 0x00000099)
736 Qt::KeyboardModifiers qmodifiers;
759 static void keyDown(JNIEnv *, jobject , jint
key, jint unicode, jint modifier, jboolean autoRepeat)
769 static void keyUp(JNIEnv *, jobject , jint
key, jint unicode, jint modifier, jboolean autoRepeat)
792 qCDebug(lcQpaInputMethods) <<
"@@@ KEYBOARDVISIBILITYCHANGED" << inputContext;
810 qCDebug(lcQpaInputMethods) <<
"@@@ handleLocationChanged" <<
id <<
x <<
y;
820 {
"touchAdd",
"(IIIZIIFFFF)V",(
void*)
touchAdd},
821 {
"touchEnd",
"(II)V",(
void*)
touchEnd},
823 {
"mouseDown",
"(III)V", (
void *)
mouseDown},
824 {
"mouseUp",
"(III)V", (
void *)
mouseUp},
825 {
"mouseMove",
"(III)V", (
void *)
mouseMove},
826 {
"mouseWheel",
"(IIIFF)V", (
void *)
mouseWheel},
827 {
"longPress",
"(III)V", (
void *)
longPress},
829 {
"tabletEvent",
"(IIJIIIFFF)V", (
void *)
tabletEvent},
830 {
"keyDown",
"(IIIZ)V", (
void *)
keyDown},
831 {
"keyUp",
"(IIIZ)V", (
void *)
keyUp},
842 __android_log_print(ANDROID_LOG_FATAL,
"Qt",
"RegisterNatives failed");
static QAndroidInputContext * androidInputContext()
State
Specifies the state of this event point.
static constexpr QKeyCombination fromCombined(int combined)
bool isEmpty() const noexcept
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
void emitInputPanelVisibleChanged()
Active QPlatformInputContext is responsible for providing visible property to QInputMethod.
void emitKeyboardRectChanged()
Active QPlatformInputContext is responsible for providing keyboardRectangle property to QInputMethod.
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
\inmodule QtCore\reentrant
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
static bool handleTouchEvent(QWindow *window, const QPointingDevice *device, const QList< struct TouchPoint > &points, Qt::KeyboardModifiers mods=Qt::NoModifier)
static bool handleTabletEvent(QWindow *window, ulong timestamp, const QPointingDevice *device, const QPointF &local, const QPointF &global, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
static bool handleTouchCancelEvent(QWindow *window, const QPointingDevice *device, Qt::KeyboardModifiers mods=Qt::NoModifier)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static void registerInputDevice(const QInputDevice *device)
static bool handleKeyEvent(QWindow *window, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
EGLImageKHR int int EGLuint64KHR * modifiers
static bool registerNatives()
Combined button and popup list for selecting options.
QBasicMutex * platformInterfaceMutex()
QWindow * topLevelWindowAt(const QPoint &globalPos)
QAndroidPlatformIntegration * androidPlatformIntegration()
int availableWidthPixels()
jclass applicationClass()
int availableHeightPixels()
@ Key_KeyboardBrightnessUp
@ Key_MediaTogglePlayPause
@ Key_KeyboardBrightnessDown
@ BlockingQueuedConnection
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
constexpr float qRadiansToDegrees(float radians)
#define Q_ARG(Type, data)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble top
GLfloat GLfloat GLfloat GLfloat h
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
static QPointingDevice::PointerType pointerType(unsigned currentCursor)