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 leftleft, int toptop, int widthwidth, int heightheight, int inputHints, int enterKeyType)
void resetSoftwareKeyboard ()
void hideSoftwareKeyboard ()
bool isSoftwareKeyboardVisible ()
QRect softwareKeyboardRect ()
int getSelectHandleWidth ()
void updateHandles (int modemode, QPoint editMenuPos, uint32_t editButtons, QPoint cursor, QPoint anchor, bool rtl)
static Qt::MouseButtons toMouseButtons (jint j_buttons)
static Qt::KeyboardModifiers mapAndroidModifiers (jint modifiersmodifiers)
static void sendMouseButtonEvents (QWindow *topLevel, QPoint localPos, QPoint globalPos, jint mouseButtonState, jint metaState, QEvent::Type typetype)
static void mouseDown (JNIEnv *, jobject, jint winId, jint xx, jint yy, jint mouseButtonState, jint metaState)
static void mouseUp (JNIEnv *, jobject, jint winId, jint xx, jint yy, jint mouseButtonState, jint metaState)
static void mouseMove (JNIEnv *, jobject, jint winId, jint xx, jint yy, jint mouseButtonState, jint metaState)
static void mouseWheel (JNIEnv *, jobject, jint winId, jint xx, jint yy, jfloat hdelta, jfloat vdelta, jint metaState)
static void longPress (JNIEnv *, jobject, jint winId, jint xx, jint yy, jint metaState)
static void touchBegin (JNIEnv *, jobject, jint)
static void touchAdd (JNIEnv *, jobject, jint winId, jint idid, jint action, jboolean, jint xx, jint yy, 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 xx, jfloat yy, jfloat pressure, jint metaState)
static QKeyCombination mapAndroidKey (int keykey)
static QString toString (jint unicode)
static bool sendKeyEventSynchronously (QEvent::Type typetype, int keykey, Qt::KeyboardModifiers modifiersmodifiers, const QString &text, bool autoRepeat)
static void keyDown (JNIEnv *, jobject, jint keykey, jint unicode, jint modifier, jboolean autoRepeat)
static void moveActivityToBackground ()
static void keyUp (JNIEnv *, jobject, jint keykey, jint unicode, jint modifier, jboolean autoRepeat)
static void keyboardVisibilityChanged (JNIEnv *, jobject, jboolean visibility)
static void keyboardGeometryChanged (JNIEnv *, jobject, jint xx, jint yy, jint ww, jint hh)
static void handleLocationChanged (JNIEnv *, jobject, int idid, int xx, int yy)
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 105 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 105 of file androidjniinput.cpp.

Function Documentation

◆ getSelectHandleWidth()

int QtAndroidInput::getSelectHandleWidth ( )

Definition at line 90 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 355 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 977 of file androidjniinput.cpp.

References QAndroidInputContext::androidInputContext().

Here is the call graph for this function:

◆ hideSoftwareKeyboard()

void QtAndroidInput::hideSoftwareKeyboard ( )

Definition at line 71 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 78 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 415 of file androidjniinput.cpp.

◆ keyboardGeometryChanged()

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

Definition at line 964 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 948 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 896 of file androidjniinput.cpp.

References m_backKeyPressAccepted, m_menuKeyPressAccepted, and sendKeyEventSynchronously().

Here is the call graph for this function:

◆ keyUp()

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

Definition at line 925 of file androidjniinput.cpp.

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

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

◆ mapAndroidModifiers()

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

Definition at line 149 of file androidjniinput.cpp.

◆ mouseDown()

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

Definition at line 194 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 226 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 209 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 245 of file androidjniinput.cpp.

References m_ignoreMouseEvents.

◆ moveActivityToBackground()

void QtAndroidInput::moveActivityToBackground ( )
static

Definition at line 916 of file androidjniinput.cpp.

Referenced by keyUp().

Here is the caller graph for this function:

◆ registerNatives()

bool QtAndroidInput::registerNatives ( QJniEnvironment & env)

Definition at line 1008 of file androidjniinput.cpp.

References methods.

◆ resetSoftwareKeyboard()

void QtAndroidInput::resetSoftwareKeyboard ( )

Definition at line 64 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:

◆ sendKeyEventSynchronously()

bool QtAndroidInput::sendKeyEventSynchronously ( QEvent::Type type,
int key,
Qt::KeyboardModifiers modifiers,
const QString & text,
bool autoRepeat )
static

Definition at line 877 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

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 171 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 54 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 85 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 424 of file androidjniinput.cpp.

◆ toMouseButtons()

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

◆ toString()

QString QtAndroidInput::toString ( jint unicode)
inlinestatic

Definition at line 872 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 304 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 299 of file androidjniinput.cpp.

References m_touchPoints.

◆ touchCancel()

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

Definition at line 398 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 380 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 96 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 46 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 42 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

◆ m_ignoreMouseEvents

bool QtAndroidInput::m_ignoreMouseEvents = false
static

Definition at line 34 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 35 of file androidjniinput.cpp.

Referenced by mouseMove(), and sendMouseButtonEvents().

◆ m_menuKeyPressAccepted

bool QtAndroidInput::m_menuKeyPressAccepted = false
static

Definition at line 43 of file androidjniinput.cpp.

Referenced by keyDown(), and keyUp().

◆ m_mouseGrabber

QPointer< QWindow > QtAndroidInput::m_mouseGrabber
static

Definition at line 41 of file androidjniinput.cpp.

Referenced by mouseDown(), and mouseUp().

◆ m_softwareKeyboardRect

QRect QtAndroidInput::m_softwareKeyboardRect
static

Definition at line 37 of file androidjniinput.cpp.

Referenced by keyboardGeometryChanged(), and keyboardVisibilityChanged().

◆ m_touchPoints

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

Definition at line 39 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 989 of file androidjniinput.cpp.

Referenced by registerNatives().