io.qt.gui.QKeyEvent Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.gui;
import io.qt.*;
/**
* Describes a key event
* Java wrapper for Qt class QKeyEvent
*/
public class QKeyEvent extends io.qt.gui.QInputEvent
{
/**
* See QKeyEvent:: QKeyEvent(QEvent::Type, int, Qt::KeyboardModifiers, QString, bool, quint16)
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, java.lang.@NonNull String text, boolean autorep, short count){
super((QPrivateConstructor)null);
initialize_native(this, type, key, modifiers, text, autorep, count);
}
private native static void initialize_native(QKeyEvent instance, io.qt.core.QEvent.Type type, int key, io.qt.core.Qt.KeyboardModifiers modifiers, java.lang.String text, boolean autorep, short count);
/**
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers, java.lang.@NonNull String text, boolean autorep, short count, io.qt.gui.@Nullable QInputDevice device){
super((QPrivateConstructor)null);
initialize_native(this, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count, device);
}
private native static void initialize_native(QKeyEvent instance, io.qt.core.QEvent.Type type, int key, io.qt.core.Qt.KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers, java.lang.String text, boolean autorep, short count, io.qt.gui.QInputDevice device);
/**
* See QKeyEvent:: QKeyEvent(QKeyEvent)
*/
protected QKeyEvent(io.qt.gui.@StrictNonNull QKeyEvent arg__1){
super((QPrivateConstructor)null);
java.util.Objects.requireNonNull(arg__1, "Argument 'arg__1': null not expected.");
initialize_native(this, arg__1);
}
private native static void initialize_native(QKeyEvent instance, io.qt.gui.QKeyEvent arg__1);
/**
*
*/
@QtUninvokable
public final int count(){
return count_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int count_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: isAutoRepeat()const
*/
@QtUninvokable
public final boolean isAutoRepeat(){
return isAutoRepeat_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isAutoRepeat_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final int key(){
return key_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int key_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: keyCombination()const
*/
@QtUninvokable
public final io.qt.gui.@NonNull QKeyCombination keyCombination(){
return keyCombination_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QKeyCombination keyCombination_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: matches(QKeySequence::StandardKey)const
*/
@QtUninvokable
public final boolean matches(io.qt.gui.QKeySequence.@NonNull StandardKey key){
return matches_native_QKeySequence_StandardKey_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), key.value());
}
@QtUninvokable
private native boolean matches_native_QKeySequence_StandardKey_constfct(long __this__nativeId, int key);
/**
* See QInputEvent:: modifiers()const
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull KeyboardModifiers modifiers(){
return new io.qt.core.Qt.KeyboardModifiers(modifiers_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int modifiers_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: nativeModifiers()const
*/
@QtUninvokable
public final int nativeModifiers(){
return nativeModifiers_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int nativeModifiers_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: nativeScanCode()const
*/
@QtUninvokable
public final int nativeScanCode(){
return nativeScanCode_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int nativeScanCode_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: nativeVirtualKey()const
*/
@QtUninvokable
public final int nativeVirtualKey(){
return nativeVirtualKey_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int nativeVirtualKey_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: operator=(QKeyEvent)
*/
@QtUninvokable
protected final void assign(io.qt.gui.@StrictNonNull QKeyEvent other){
java.util.Objects.requireNonNull(other, "Argument 'other': null not expected.");
assign_native_cref_QKeyEvent(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void assign_native_cref_QKeyEvent(long __this__nativeId, long other);
/**
*
*/
@QtUninvokable
public final java.lang.@NonNull String text(){
return text_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String text_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
@Override
public io.qt.gui.@Nullable QKeyEvent clone(){
return clone_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QKeyEvent clone_native_constfct(long __this__nativeId);
/**
* See QKeyEvent:: m_autoRepeat
*/
@QtUninvokable
protected final void setAutoRepeat(boolean autoRepeat){
setAutoRepeat_native_quint16(QtJambi_LibraryUtilities.internal.nativeId(this), autoRepeat);
}
@QtUninvokable
private native void setAutoRepeat_native_quint16(long __this__nativeId, boolean autoRepeat);
/**
* See QKeyEvent:: m_count
*/
@QtUninvokable
protected final void setCount(short count){
setCount_native_quint16(QtJambi_LibraryUtilities.internal.nativeId(this), count);
}
@QtUninvokable
private native void setCount_native_quint16(long __this__nativeId, short count);
/**
* See QKeyEvent:: m_scanCode
*/
@QtUninvokable
protected final void setScanCode(int scanCode){
setScanCode_native_quint32(QtJambi_LibraryUtilities.internal.nativeId(this), scanCode);
}
@QtUninvokable
private native void setScanCode_native_quint32(long __this__nativeId, int scanCode);
/**
* See QKeyEvent:: m_scanCode
*/
@QtUninvokable
protected final int scanCode(){
return scanCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int scanCode_native(long __this__nativeId);
/**
* See QKeyEvent:: m_virtualKey
*/
@QtUninvokable
protected final void setVirtualKey(int virtualKey){
setVirtualKey_native_quint32(QtJambi_LibraryUtilities.internal.nativeId(this), virtualKey);
}
@QtUninvokable
private native void setVirtualKey_native_quint32(long __this__nativeId, int virtualKey);
/**
* See QKeyEvent:: m_virtualKey
*/
@QtUninvokable
protected final int virtualKey(){
return virtualKey_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int virtualKey_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QKeyEvent(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, java.lang.String, boolean, short)}
* with count = 1
.
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, java.lang.@NonNull String text, boolean autorep) {
this(type, key, modifiers, text, autorep, (short)1);
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, java.lang.String, boolean, short)}
* with:
* autorep = false
* count = 1
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, java.lang.@NonNull String text) {
this(type, key, modifiers, text, (boolean)false, (short)1);
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, java.lang.String, boolean, short)}
* with:
* text = (String)null
* autorep = false
* count = 1
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers) {
this(type, key, modifiers, (String)null, (boolean)false, (short)1);
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, int, int, int, java.lang.String, boolean, short, io.qt.gui.QInputDevice)}
* with device = io.qt.gui.QInputDevice.primaryKeyboard()
.
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers, java.lang.@NonNull String text, boolean autorep, short count) {
this(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count, io.qt.gui.QInputDevice.primaryKeyboard());
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, int, int, int, java.lang.String, boolean, short, io.qt.gui.QInputDevice)}
* with:
* count = 1
* device = io.qt.gui.QInputDevice.primaryKeyboard()
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers, java.lang.@NonNull String text, boolean autorep) {
this(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, (short)1, io.qt.gui.QInputDevice.primaryKeyboard());
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, int, int, int, java.lang.String, boolean, short, io.qt.gui.QInputDevice)}
* with:
* autorep = false
* count = 1
* device = io.qt.gui.QInputDevice.primaryKeyboard()
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers, java.lang.@NonNull String text) {
this(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, (boolean)false, (short)1, io.qt.gui.QInputDevice.primaryKeyboard());
}
/**
* Overloaded constructor for {@link #QKeyEvent(io.qt.core.QEvent.Type, int, io.qt.core.Qt.KeyboardModifiers, int, int, int, java.lang.String, boolean, short, io.qt.gui.QInputDevice)}
* with:
* text = (String)null
* autorep = false
* count = 1
* device = io.qt.gui.QInputDevice.primaryKeyboard()
*
*/
public QKeyEvent(io.qt.core.QEvent.@NonNull Type type, int key, io.qt.core.Qt.@NonNull KeyboardModifiers modifiers, int nativeScanCode, int nativeVirtualKey, int nativeModifiers) {
this(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, (String)null, (boolean)false, (short)1, io.qt.gui.QInputDevice.primaryKeyboard());
}
/**
* @deprecated Use {@link #assign(io.qt.gui.QKeyEvent)} instead.
*/
@Deprecated
@QtUninvokable
protected final void set(io.qt.gui.@StrictNonNull QKeyEvent other) {
assign(other);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #scanCode()} instead.
*/
@QtUninvokable
protected final int getScanCode() {
return scanCode();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #virtualKey()} instead.
*/
@QtUninvokable
protected final int getVirtualKey() {
return virtualKey();
}
}