Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QtAndroidInput Namespace Reference

Functions

void updateSelection (int selStart, int selEnd, int candidatesStart, int candidatesEnd)
 
void showSoftwareKeyboard (int left, int top, int width, int height, int inputHints, int enterKeyType)
 
void resetSoftwareKeyboard ()
 
void hideSoftwareKeyboard ()
 
bool isSoftwareKeyboardVisible ()
 
QRect softwareKeyboardRect ()
 
int getSelectHandleWidth ()
 
void updateHandles (int mode, QPoint editMenuPos, uint32_t editButtons, QPoint cursor, QPoint anchor, bool rtl)
 
static void mouseDown (JNIEnv *, jobject, jint, jint x, jint y)
 
static void mouseUp (JNIEnv *, jobject, jint, jint x, jint y)
 
static void mouseMove (JNIEnv *, jobject, jint, jint x, jint y)
 
static void mouseWheel (JNIEnv *, jobject, jint, jint x, jint y, jfloat hdelta, jfloat vdelta)
 
static void longPress (JNIEnv *, jobject, jint, jint x, jint y)
 
static void touchBegin (JNIEnv *, jobject, jint)
 
static void touchAdd (JNIEnv *, jobject, jint, jint id, jint action, jboolean, jint x, jint y, jfloat major, jfloat minor, jfloat rotation, jfloat pressure)
 
static QPointingDevicegetTouchDevice ()
 
static void touchEnd (JNIEnv *, jobject, jint, jint)
 
static void touchCancel (JNIEnv *, jobject, jint)
 
static bool isTabletEventSupported (JNIEnv *, jobject)
 
static void tabletEvent (JNIEnv *, jobject, jint, jint deviceId, jlong time, jint action, jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure)
 
static QKeyCombination mapAndroidKey (int key)
 
static Qt::KeyboardModifiers mapAndroidModifiers (jint modifiers)
 
static QString toString (jint unicode)
 
static void keyDown (JNIEnv *, jobject, jint key, jint unicode, jint modifier, jboolean autoRepeat)
 
static void keyUp (JNIEnv *, jobject, jint key, jint unicode, jint modifier, jboolean autoRepeat)
 
static void keyboardVisibilityChanged (JNIEnv *, jobject, jboolean visibility)
 
static void keyboardGeometryChanged (JNIEnv *, jobject, jint x, jint y, jint w, jint h)
 
static void handleLocationChanged (JNIEnv *, jobject, int id, int x, int y)
 
bool registerNatives (JNIEnv *env)
 

Variables

static bool m_ignoreMouseEvents = false
 
static QRect m_softwareKeyboardRect
 
static QList< QWindowSystemInterface::TouchPointm_touchPoints
 
static QPointer< QWindowm_mouseGrabber
 
static JNINativeMethod methods []
 

Function Documentation

◆ getSelectHandleWidth()

int QtAndroidInput::getSelectHandleWidth ( )

Definition at line 81 of file androidjniinput.cpp.

References QtAndroid::applicationClass().

Referenced by QAndroidInputContext::updateSelectionHandles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTouchDevice()

static QPointingDevice * QtAndroidInput::getTouchDevice ( )
static

Definition at line 228 of file androidjniinput.cpp.

References QtAndroid::androidPlatformIntegration(), QInputDevice::Area, QPointingDevice::Finger, QInputDevice::NormalizedPosition, QInputDevice::Position, QInputDevice::Pressure, QWindowSystemInterface::registerInputDevice(), QAndroidPlatformIntegration::setTouchDevice(), QAndroidPlatformIntegration::touchDevice(), and QInputDevice::TouchScreen.

Referenced by touchCancel(), and touchEnd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleLocationChanged()

static void QtAndroidInput::handleLocationChanged ( JNIEnv *  ,
jobject  ,
int  id,
int  x,
int  y 
)
static

Definition at line 808 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), Qt::BlockingQueuedConnection, QMetaObject::invokeMethod(), Q_ARG, qCDebug, and qGuiApp.

+ Here is the call graph for this function:

◆ hideSoftwareKeyboard()

void QtAndroidInput::hideSoftwareKeyboard ( )

Definition at line 65 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), and qCDebug.

Referenced by QAndroidInputContext::hideInputPanel(), and QAndroidInputContext::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSoftwareKeyboardVisible()

bool QtAndroidInput::isSoftwareKeyboardVisible ( )

Definition at line 71 of file androidjniinput.cpp.

References QtAndroid::applicationClass().

Referenced by QAndroidInputContext::isInputPanelVisible().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTabletEventSupported()

static bool QtAndroidInput::isTabletEventSupported ( JNIEnv *  ,
jobject   
)
static

Definition at line 279 of file androidjniinput.cpp.

◆ keyboardGeometryChanged()

static void QtAndroidInput::keyboardGeometryChanged ( JNIEnv *  ,
jobject  ,
jint  x,
jint  y,
jint  w,
jint  h 
)
static

Definition at line 795 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), QPlatformInputContext::emitKeyboardRectChanged(), m_softwareKeyboardRect, qCDebug, and qGuiApp.

+ Here is the call graph for this function:

◆ keyboardVisibilityChanged()

static void QtAndroidInput::keyboardVisibilityChanged ( JNIEnv *  ,
jobject  ,
jboolean  visibility 
)
static

Definition at line 779 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), QPlatformInputContext::emitInputPanelVisibleChanged(), QPlatformInputContext::emitKeyboardRectChanged(), QMetaObject::invokeMethod(), m_softwareKeyboardRect, qCDebug, qGuiApp, and Qt::QueuedConnection.

+ Here is the call graph for this function:

◆ keyDown()

static void QtAndroidInput::keyDown ( JNIEnv *  ,
jobject  ,
jint  key,
jint  unicode,
jint  modifier,
jboolean  autoRepeat 
)
static

Definition at line 759 of file androidjniinput.cpp.

References QWindowSystemInterface::handleKeyEvent(), QEvent::KeyPress, mapAndroidKey(), mapAndroidModifiers(), and toString().

+ Here is the call graph for this function:

◆ keyUp()

static void QtAndroidInput::keyUp ( JNIEnv *  ,
jobject  ,
jint  key,
jint  unicode,
jint  modifier,
jboolean  autoRepeat 
)
static

Definition at line 769 of file androidjniinput.cpp.

References QWindowSystemInterface::handleKeyEvent(), QEvent::KeyRelease, mapAndroidKey(), mapAndroidModifiers(), and toString().

+ Here is the call graph for this function:

◆ longPress()

static void QtAndroidInput::longPress ( JNIEnv *  ,
jobject  ,
jint  ,
jint  x,
jint  y 
)
static

Definition at line 157 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), QWindowSystemInterface::handleMouseEvent(), QMetaObject::invokeMethod(), m_ignoreMouseEvents, m_mouseGrabber, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, Qt::NoButton, Q_ARG, qEnvironmentVariableIntValue(), qGuiApp, Qt::RightButton, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ mapAndroidKey()

static QKeyCombination QtAndroidInput::mapAndroidKey ( int  key)
static

Definition at line 334 of file androidjniinput.cpp.

References QKeyCombination::fromCombined(), Qt::Key_0, Qt::Key_A, Qt::Key_AddFavorite, Qt::Key_Alt, Qt::Key_Apostrophe, Qt::Key_Asterisk, Qt::Key_At, Qt::Key_AudioCycleTrack, Qt::Key_AudioForward, Qt::Key_AudioRewind, Qt::Key_Back, Qt::Key_Backslash, Qt::Key_Backspace, Qt::Key_Blue, Qt::Key_BracketLeft, Qt::Key_BracketRight, Qt::Key_Calculator, Qt::Key_Calendar, Qt::Key_Call, Qt::Key_Camera, Qt::Key_CameraFocus, Qt::Key_CapsLock, Qt::Key_ChannelDown, Qt::Key_ChannelUp, Qt::Key_Clear, Qt::Key_Comma, Qt::Key_Control, Qt::Key_Delete, Qt::Key_Down, Qt::Key_Eject, Qt::Key_End, Qt::Key_Enter, Qt::Key_Equal, Qt::Key_Escape, Qt::Key_Explorer, Qt::Key_F1, Qt::Key_Forward, Qt::Key_Green, Qt::Key_Guide, Qt::Key_Hangup, Qt::Key_Home, Qt::Key_Info, Qt::Key_Insert, Qt::Key_KeyboardBrightnessDown, Qt::Key_KeyboardBrightnessUp, Qt::Key_LaunchMail, Qt::Key_Left, Qt::Key_MediaNext, Qt::Key_MediaPause, Qt::Key_MediaPlay, Qt::Key_MediaPrevious, Qt::Key_MediaRecord, Qt::Key_MediaStop, Qt::Key_MediaTogglePlayPause, Qt::Key_Menu, Qt::Key_Meta, Qt::Key_MicMute, Qt::Key_Minus, Qt::Key_Music, Qt::Key_NumberSign, Qt::Key_NumLock, Qt::Key_PageDown, Qt::Key_PageUp, Qt::Key_ParenLeft, Qt::Key_ParenRight, Qt::Key_Pause, Qt::Key_Period, Qt::Key_Plus, Qt::Key_PowerOff, Qt::Key_Print, Qt::Key_QuoteLeft, Qt::Key_Red, Qt::Key_Return, Qt::Key_Right, Qt::Key_ScrollLock, Qt::Key_Search, Qt::Key_Semicolon, Qt::Key_Settings, Qt::Key_Shift, Qt::Key_Slash, Qt::Key_Space, Qt::Key_Subtitle, Qt::Key_Tab, Qt::Key_unknown, Qt::Key_Up, Qt::Key_VolumeDown, Qt::Key_VolumeMute, Qt::Key_VolumeUp, Qt::Key_Yellow, Qt::Key_ZoomIn, Qt::Key_ZoomOut, Qt::KeypadModifier, and qWarning.

Referenced by keyDown(), and keyUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapAndroidModifiers()

static Qt::KeyboardModifiers QtAndroidInput::mapAndroidModifiers ( jint  modifiers)
static

Definition at line 734 of file androidjniinput.cpp.

References Qt::AltModifier, Qt::ControlModifier, Qt::MetaModifier, and Qt::ShiftModifier.

Referenced by keyDown(), and keyUp().

+ Here is the caller graph for this function:

◆ mouseDown()

static void QtAndroidInput::mouseDown ( JNIEnv *  ,
jobject  ,
jint  ,
jint  x,
jint  y 
)
static

Definition at line 94 of file androidjniinput.cpp.

References QWindowSystemInterface::handleMouseEvent(), Qt::LeftButton, m_ignoreMouseEvents, m_mouseGrabber, QEvent::MouseButtonPress, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ mouseMove()

static void QtAndroidInput::mouseMove ( JNIEnv *  ,
jobject  ,
jint  ,
jint  x,
jint  y 
)
static

Definition at line 122 of file androidjniinput.cpp.

References QPointer< T >::data(), QWindowSystemInterface::handleMouseEvent(), Qt::LeftButton, m_ignoreMouseEvents, m_mouseGrabber, QEvent::MouseMove, Qt::NoButton, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ mouseUp()

static void QtAndroidInput::mouseUp ( JNIEnv *  ,
jobject  ,
jint  ,
jint  x,
jint  y 
)
static

Definition at line 108 of file androidjniinput.cpp.

References QPointer< T >::data(), QWindowSystemInterface::handleMouseEvent(), Qt::LeftButton, m_ignoreMouseEvents, m_mouseGrabber, QEvent::MouseButtonRelease, Qt::NoButton, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ mouseWheel()

static void QtAndroidInput::mouseWheel ( JNIEnv *  ,
jobject  ,
jint  ,
jint  x,
jint  y,
jfloat  hdelta,
jfloat  vdelta 
)
static

Definition at line 138 of file androidjniinput.cpp.

References QPointer< T >::data(), QWindowSystemInterface::handleWheelEvent(), m_ignoreMouseEvents, m_mouseGrabber, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ registerNatives()

bool QtAndroidInput::registerNatives ( JNIEnv *  env)

Definition at line 837 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), and methods.

Referenced by JNI_OnLoad().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetSoftwareKeyboard()

void QtAndroidInput::resetSoftwareKeyboard ( )

Definition at line 59 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), and qCDebug.

Referenced by QAndroidInputContext::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSoftwareKeyboard()

void QtAndroidInput::showSoftwareKeyboard ( int  left,
int  top,
int  width,
int  height,
int  inputHints,
int  enterKeyType 
)

Definition at line 45 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), and qCDebug.

Referenced by QAndroidInputContext::showInputPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ softwareKeyboardRect()

QRect QtAndroidInput::softwareKeyboardRect ( )

Definition at line 76 of file androidjniinput.cpp.

References m_softwareKeyboardRect.

Referenced by QAndroidInputContext::keyboardRect().

+ Here is the caller graph for this function:

◆ tabletEvent()

static void QtAndroidInput::tabletEvent ( JNIEnv *  ,
jobject  ,
jint  ,
jint  deviceId,
jlong  time,
jint  action,
jint  pointerType,
jint  buttonState,
jfloat  x,
jfloat  y,
jfloat  pressure 
)
static

Definition at line 288 of file androidjniinput.cpp.

References QWindowSystemInterface::handleTabletEvent(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier, pointerType(), qCDebug, QInputDevice::Stylus, time, and QtAndroid::topLevelWindowAt().

+ Here is the call graph for this function:

◆ toString()

static QString QtAndroidInput::toString ( jint  unicode)
inlinestatic

Definition at line 754 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

+ Here is the caller graph for this function:

◆ touchAdd()

static void QtAndroidInput::touchAdd ( JNIEnv *  ,
jobject  ,
jint  ,
jint  id,
jint  action,
jboolean  ,
jint  x,
jint  y,
jfloat  major,
jfloat  minor,
jfloat  rotation,
jfloat  pressure 
)
static

◆ touchBegin()

static void QtAndroidInput::touchBegin ( JNIEnv *  ,
jobject  ,
jint   
)
static

Definition at line 183 of file androidjniinput.cpp.

References QList< T >::clear(), and m_touchPoints.

+ Here is the call graph for this function:

◆ touchCancel()

static void QtAndroidInput::touchCancel ( JNIEnv *  ,
jobject  ,
jint   
)
static

Definition at line 265 of file androidjniinput.cpp.

References QWindowSystemInterface::TouchPoint::area, QList< T >::at(), QRectF::center(), getTouchDevice(), QWindowSystemInterface::handleTouchCancelEvent(), QList< T >::isEmpty(), lock, m_touchPoints, QtAndroid::platformInterfaceMutex(), QtAndroid::topLevelWindowAt(), QPointF::toPoint(), and window().

+ Here is the call graph for this function:

◆ touchEnd()

static void QtAndroidInput::touchEnd ( JNIEnv *  ,
jobject  ,
jint  ,
jint   
)
static

Definition at line 251 of file androidjniinput.cpp.

References QWindowSystemInterface::TouchPoint::area, QList< T >::at(), QRectF::center(), getTouchDevice(), QWindowSystemInterface::handleTouchEvent(), QList< T >::isEmpty(), lock, m_touchPoints, QtAndroid::platformInterfaceMutex(), QtAndroid::topLevelWindowAt(), QPointF::toPoint(), and window().

+ Here is the call graph for this function:

◆ updateHandles()

void QtAndroidInput::updateHandles ( int  mode,
QPoint  editMenuPos,
uint32_t  editButtons,
QPoint  cursor,
QPoint  anchor,
bool  rtl 
)

Definition at line 86 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), cursor, QPoint::x(), and QPoint::y().

Referenced by QAndroidInputContext::updateSelectionHandles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSelection()

void QtAndroidInput::updateSelection ( int  selStart,
int  selEnd,
int  candidatesStart,
int  candidatesEnd 
)

Definition at line 33 of file androidjniinput.cpp.

References QtAndroid::applicationClass(), and qCDebug.

Referenced by QAndroidInputContext::updateCursorPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ m_ignoreMouseEvents

bool QtAndroidInput::m_ignoreMouseEvents = false
static

Definition at line 26 of file androidjniinput.cpp.

Referenced by longPress(), mouseDown(), mouseMove(), mouseUp(), and mouseWheel().

◆ m_mouseGrabber

QPointer<QWindow> QtAndroidInput::m_mouseGrabber
static

Definition at line 31 of file androidjniinput.cpp.

Referenced by longPress(), mouseDown(), mouseMove(), mouseUp(), and mouseWheel().

◆ m_softwareKeyboardRect

QRect QtAndroidInput::m_softwareKeyboardRect
static

◆ m_touchPoints

QList<QWindowSystemInterface::TouchPoint> QtAndroidInput::m_touchPoints
static

Definition at line 29 of file androidjniinput.cpp.

Referenced by touchAdd(), touchBegin(), touchCancel(), and touchEnd().

◆ methods

JNINativeMethod QtAndroidInput::methods[]
static
Initial value:
= {
{"touchBegin","(I)V",(void*)touchBegin},
{"touchAdd","(IIIZIIFFFF)V",(void*)touchAdd},
{"touchEnd","(II)V",(void*)touchEnd},
{"touchCancel", "(I)V", (void *)touchCancel},
{"mouseDown", "(III)V", (void *)mouseDown},
{"mouseUp", "(III)V", (void *)mouseUp},
{"mouseMove", "(III)V", (void *)mouseMove},
{"mouseWheel", "(IIIFF)V", (void *)mouseWheel},
{"longPress", "(III)V", (void *)longPress},
{"isTabletEventSupported", "()Z", (void *)isTabletEventSupported},
{"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent},
{"keyDown", "(IIIZ)V", (void *)keyDown},
{"keyUp", "(IIIZ)V", (void *)keyUp},
{"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged},
{"keyboardGeometryChanged", "(IIII)V", (void *)keyboardGeometryChanged},
{"handleLocationChanged", "(III)V", (void *)handleLocationChanged}
}

Definition at line 818 of file androidjniinput.cpp.

Referenced by registerNatives().