Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtAndroidInput Namespace Reference

Enumerations

enum  AndroidMouseButton {
  BUTTON_PRIMARY = 0x00000001 , BUTTON_SECONDARY = 0x00000002 , BUTTON_TERTIARY = 0x00000004 , BUTTON_BACK = 0x00000008 ,
  BUTTON_FORWARD = 0x00000010 , BUTTON_STYLUS_PRIMARY = 0x00000020 , BUTTON_STYLUS_SECONDARY = 0x00000040 , BUTTON_PRIMARY = 0x00000001 ,
  BUTTON_SECONDARY = 0x00000002 , BUTTON_TERTIARY = 0x00000004 , BUTTON_BACK = 0x00000008 , BUTTON_FORWARD = 0x00000010 ,
  BUTTON_STYLUS_PRIMARY = 0x00000020 , BUTTON_STYLUS_SECONDARY = 0x00000040
}
enum  AndroidMouseButton {
  BUTTON_PRIMARY = 0x00000001 , BUTTON_SECONDARY = 0x00000002 , BUTTON_TERTIARY = 0x00000004 , BUTTON_BACK = 0x00000008 ,
  BUTTON_FORWARD = 0x00000010 , BUTTON_STYLUS_PRIMARY = 0x00000020 , BUTTON_STYLUS_SECONDARY = 0x00000040 , BUTTON_PRIMARY = 0x00000001 ,
  BUTTON_SECONDARY = 0x00000002 , BUTTON_TERTIARY = 0x00000004 , BUTTON_BACK = 0x00000008 , BUTTON_FORWARD = 0x00000010 ,
  BUTTON_STYLUS_PRIMARY = 0x00000020 , BUTTON_STYLUS_SECONDARY = 0x00000040
}

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 Qt::MouseButtons toMouseButtons (jint j_buttons)
static Qt::KeyboardModifiers mapAndroidModifiers (jint modifiers)
static void sendMouseButtonEvents (QWindow *topLevel, QPoint localPos, QPoint globalPos, jint mouseButtonState, jint metaState, QEvent::Type type)
static void mouseDown (JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static void mouseUp (JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static void mouseMove (JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static void mouseWheel (JNIEnv *, jobject, jint winId, jint x, jint y, jfloat hdelta, jfloat vdelta, jint metaState)
static void longPress (JNIEnv *, jobject, jint winId, jint x, jint y, jint metaState)
static void touchBegin (JNIEnv *, jobject, jint)
static void touchAdd (JNIEnv *, jobject, jint winId, jint id, jint action, jboolean, jint x, jint y, jfloat major, jfloat minor, jfloat rotation, jfloat pressure)
static QPointingDevice * getTouchDevice ()
static void touchEnd (JNIEnv *, jobject, jint winId, jint, jint metaState)
static void touchCancel (JNIEnv *, jobject, jint winId, jint metaState)
static bool isTabletEventSupported (JNIEnv *, jobject)
static void tabletEvent (JNIEnv *, jobject, jint winId, jint deviceId, jlong time, jint action, jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure, jint metaState)
static QKeyCombination mapAndroidKey (int key)
static QString toString (jint unicode)
static void keyDown (JNIEnv *, jobject, jint key, jint unicode, jint modifier, jboolean autoRepeat)
static void moveActivityToBackground ()
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 (QJniEnvironment &env)

Variables

static bool m_ignoreMouseEvents = false
static Qt::MouseButtons m_lastSeenButtons = Qt::NoButton
static QRect m_softwareKeyboardRect
static QList< QWindowSystemInterface::TouchPoint > m_touchPoints
static QPointer< QWindow > m_mouseGrabber
static bool m_backKeyPressAccepted = false
static bool m_menuKeyPressAccepted = false
static const JNINativeMethod methods []

Enumeration Type Documentation

◆ AndroidMouseButton [1/2]

Enumerator
BUTTON_PRIMARY 
BUTTON_SECONDARY 
BUTTON_TERTIARY 
BUTTON_BACK 
BUTTON_FORWARD 
BUTTON_STYLUS_PRIMARY 
BUTTON_STYLUS_SECONDARY 
BUTTON_PRIMARY 
BUTTON_SECONDARY 
BUTTON_TERTIARY 
BUTTON_BACK 
BUTTON_FORWARD 
BUTTON_STYLUS_PRIMARY 
BUTTON_STYLUS_SECONDARY 

Definition at line 104 of file androidjniinput.cpp.

◆ AndroidMouseButton [2/2]

Enumerator
BUTTON_PRIMARY 
BUTTON_SECONDARY 
BUTTON_TERTIARY 
BUTTON_BACK 
BUTTON_FORWARD 
BUTTON_STYLUS_PRIMARY 
BUTTON_STYLUS_SECONDARY 
BUTTON_PRIMARY 
BUTTON_SECONDARY 
BUTTON_TERTIARY 
BUTTON_BACK 
BUTTON_FORWARD 
BUTTON_STYLUS_PRIMARY 
BUTTON_STYLUS_SECONDARY 

Definition at line 104 of file androidjniinput.cpp.

Function Documentation

◆ getSelectHandleWidth()

int QtAndroidInput::getSelectHandleWidth ( )

Definition at line 89 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

Referenced by QAndroidInputContext::updateSelectionHandles().

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

◆ getTouchDevice()

QPointingDevice * QtAndroidInput::getTouchDevice ( )
static

Definition at line 351 of file androidjniinput.cpp.

References QtAndroid::androidPlatformIntegration().

Here is the call graph for this function:

◆ handleLocationChanged()

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

Definition at line 956 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext().

Here is the call graph for this function:

◆ hideSoftwareKeyboard()

void QtAndroidInput::hideSoftwareKeyboard ( )

Definition at line 70 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

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 77 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

Referenced by QAndroidInputContext::isInputPanelVisible().

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

◆ isTabletEventSupported()

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

Definition at line 411 of file androidjniinput.cpp.

◆ keyboardGeometryChanged()

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

Definition at line 943 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), and m_softwareKeyboardRect.

Here is the call graph for this function:

◆ keyboardVisibilityChanged()

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

Definition at line 927 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), and m_softwareKeyboardRect.

Here is the call graph for this function:

◆ keyDown()

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

Definition at line 873 of file androidjniinput.cpp.

References m_backKeyPressAccepted, and m_menuKeyPressAccepted.

◆ keyUp()

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

Definition at line 903 of file androidjniinput.cpp.

References m_backKeyPressAccepted, m_menuKeyPressAccepted, moveActivityToBackground(), and QtAndroidMenu::openOptionsMenu().

Here is the call graph for this function:

◆ longPress()

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

Definition at line 263 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), and m_ignoreMouseEvents.

Here is the call graph for this function:

◆ mapAndroidKey()

QKeyCombination QtAndroidInput::mapAndroidKey ( int key)
static

Definition at line 467 of file androidjniinput.cpp.

◆ mapAndroidModifiers()

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

Definition at line 148 of file androidjniinput.cpp.

◆ mouseDown()

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

Definition at line 190 of file androidjniinput.cpp.

References m_ignoreMouseEvents, and m_mouseGrabber.

◆ mouseMove()

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

Definition at line 222 of file androidjniinput.cpp.

References m_ignoreMouseEvents, and m_lastSeenButtons.

◆ mouseUp()

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

Definition at line 205 of file androidjniinput.cpp.

References m_ignoreMouseEvents, and m_mouseGrabber.

◆ mouseWheel()

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

Definition at line 241 of file androidjniinput.cpp.

References m_ignoreMouseEvents.

◆ moveActivityToBackground()

void QtAndroidInput::moveActivityToBackground ( )
static

Definition at line 894 of file androidjniinput.cpp.

Referenced by keyUp().

Here is the caller graph for this function:

◆ registerNatives()

bool QtAndroidInput::registerNatives ( QJniEnvironment & env)

Definition at line 986 of file androidjniinput.cpp.

References methods.

◆ resetSoftwareKeyboard()

void QtAndroidInput::resetSoftwareKeyboard ( )

Definition at line 63 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

Referenced by QAndroidInputContext::reset().

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

◆ sendMouseButtonEvents()

void QtAndroidInput::sendMouseButtonEvents ( QWindow * topLevel,
QPoint localPos,
QPoint globalPos,
jint mouseButtonState,
jint metaState,
QEvent::Type type )
static

Definition at line 167 of file androidjniinput.cpp.

References m_lastSeenButtons.

◆ showSoftwareKeyboard()

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

Definition at line 53 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

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 84 of file androidjniinput.cpp.

◆ tabletEvent()

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

Definition at line 420 of file androidjniinput.cpp.

◆ toMouseButtons()

Qt::MouseButtons QtAndroidInput::toMouseButtons ( jint j_buttons)
static

◆ toString()

QString QtAndroidInput::toString ( jint unicode)
inlinestatic

Definition at line 868 of file androidjniinput.cpp.

◆ touchAdd()

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

Definition at line 300 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext(), m_touchPoints, and QtAndroid::windowFromId().

Here is the call graph for this function:

◆ touchBegin()

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

Definition at line 295 of file androidjniinput.cpp.

References m_touchPoints.

◆ touchCancel()

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

Definition at line 394 of file androidjniinput.cpp.

References m_touchPoints, QtAndroid::platformInterfaceMutex(), and QtAndroid::windowFromId().

Here is the call graph for this function:

◆ touchEnd()

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

Definition at line 376 of file androidjniinput.cpp.

References m_touchPoints, QtAndroid::platformInterfaceMutex(), and QtAndroid::windowFromId().

Here is the call graph for this function:

◆ updateHandles()

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

Definition at line 95 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

Here is the call graph for this function:

◆ updateSelection()

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

Definition at line 45 of file androidjniinput.cpp.

References QtAndroid::backendRegister().

Referenced by QAndroidInputContext::updateCursorPosition().

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

Variable Documentation

◆ m_backKeyPressAccepted

bool QtAndroidInput::m_backKeyPressAccepted = false
static

Definition at line 41 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

◆ m_ignoreMouseEvents

bool QtAndroidInput::m_ignoreMouseEvents = false
static

Definition at line 33 of file androidjniinput.cpp.

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

◆ m_lastSeenButtons

Qt::MouseButtons QtAndroidInput::m_lastSeenButtons = Qt::NoButton
static

Definition at line 34 of file androidjniinput.cpp.

Referenced by mouseMove(), and sendMouseButtonEvents().

◆ m_menuKeyPressAccepted

bool QtAndroidInput::m_menuKeyPressAccepted = false
static

Definition at line 42 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

◆ m_mouseGrabber

QPointer< QWindow > QtAndroidInput::m_mouseGrabber
static

Definition at line 40 of file androidjniinput.cpp.

Referenced by mouseDown(), and mouseUp().

◆ m_softwareKeyboardRect

QRect QtAndroidInput::m_softwareKeyboardRect
static

Definition at line 36 of file androidjniinput.cpp.

Referenced by keyboardGeometryChanged(), and keyboardVisibilityChanged().

◆ m_touchPoints

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

Definition at line 38 of file androidjniinput.cpp.

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

◆ methods

const JNINativeMethod QtAndroidInput::methods
static
Initial value:
= {
{"touchBegin","(I)V",(void*)touchBegin},
{"touchAdd","(IIIZIIFFFF)V",(void*)touchAdd},
{"touchEnd","(III)V",(void*)touchEnd},
{"touchCancel", "(II)V", (void *)touchCancel},
{"mouseDown", "(IIIII)V", (void *)mouseDown},
{"mouseUp", "(IIIII)V", (void *)mouseUp},
{"mouseMove", "(IIIII)V", (void *)mouseMove},
{"mouseWheel", "(IIIFFI)V", (void *)mouseWheel},
{"longPress", "(IIII)V", (void *)longPress},
{"isTabletEventSupported", "()Z", (void *)isTabletEventSupported},
{"tabletEvent", "(IIJIIIFFFI)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},
}
static void tabletEvent(JNIEnv *, jobject, jint winId, jint deviceId, jlong time, jint action, jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure, jint metaState)
static void touchEnd(JNIEnv *, jobject, jint winId, jint, jint metaState)
static void mouseDown(JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static bool isTabletEventSupported(JNIEnv *, jobject)
static void touchBegin(JNIEnv *, jobject, jint)
static void mouseWheel(JNIEnv *, jobject, jint winId, jint x, jint y, jfloat hdelta, jfloat vdelta, jint metaState)
static void keyUp(JNIEnv *, jobject, jint key, jint unicode, jint modifier, jboolean autoRepeat)
static void touchAdd(JNIEnv *, jobject, jint winId, jint id, jint action, jboolean, jint x, jint y, jfloat major, jfloat minor, jfloat rotation, jfloat pressure)
static void touchCancel(JNIEnv *, jobject, jint winId, jint metaState)
static void keyboardGeometryChanged(JNIEnv *, jobject, jint x, jint y, jint w, jint h)
static void keyboardVisibilityChanged(JNIEnv *, jobject, jboolean visibility)
static void keyDown(JNIEnv *, jobject, jint key, jint unicode, jint modifier, jboolean autoRepeat)
static void handleLocationChanged(JNIEnv *, jobject, int id, int x, int y)
static void mouseUp(JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static void mouseMove(JNIEnv *, jobject, jint winId, jint x, jint y, jint mouseButtonState, jint metaState)
static void longPress(JNIEnv *, jobject, jint winId, jint x, jint y, jint metaState)

Definition at line 967 of file androidjniinput.cpp.

Referenced by registerNatives().