org.kde.koala
public class KShortcut extends Object implements QtSupport
KAction closeAction = KStdAction.close( this, SLOT("close()"), actionCollection() ); KShortcut closeShortcut = closeAction.shortcut(); closeShortcut.append( KKey(Key_Escape)); closeAction.setShortcut(closeShortcut);Note that a shortcut cannot have more than 2 key combinations associated with it, so the above code would not do anything (and append() would return false) if the closeAction already had an key and alternate key.
UNKNOWN: The KShortcut class is used to represent a keyboard shortcut to an action.
Field Summary | |
---|---|
static int | MAX_SEQUENCES
The maximum number of key sequences that can be contained in
a KShortcut. |
Constructor Summary | |
---|---|
protected | KShortcut(Class dummy) |
KShortcut()
Creates a new null shortcut. | |
KShortcut(int keyQt)
Creates a new shortcut with the given Qt key code
as the only key sequence. | |
KShortcut(QKeySequence keySeq)
Creates a new shortcut that contains only the given qt key
sequence. | |
KShortcut(KKey key)
Creates a new shortcut that contains only the given key
in its only sequence. | |
KShortcut(KKeySequence keySeq)
Creates a new shortcut that contains only the given key
sequence. | |
KShortcut(KShortcut shortcut)
Copies the given shortcut. | |
KShortcut(String shortcut)
Creates a new key sequence that contains the given key sequence.
|
Method Summary | |
---|---|
boolean | append(KKeySequence keySeq)
Appends the given key sequence. |
boolean | append(KKey spec)
Appends the given key |
boolean | append(KShortcut cut)
Appends the sequences from the given shortcut. |
void | clear()
Clears the shortcut. |
int | compare(KShortcut shortcut)
Compares this object with the given shortcut. |
boolean | contains(KKey key)
Checks whether this shortcut contains a sequence that starts
with the given key. |
boolean | contains(KKeySequence keySeq)
Checks whether this shortcut contains the given sequence. |
int | count()
Returns the number of sequences that are in this
shortcut. |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | init(int keyQt)
Initializes the shortcut with the given Qt key code
as the only key sequence. |
boolean | init(QKeySequence keySeq)
Initializes the shortcut with the given qt key sequence. |
boolean | init(KKey key)
Initializes the shortcut with the given key as its only sequence. |
boolean | init(KKeySequence keySeq)
Initializes the shortcut with the given qt key sequence. |
boolean | init(KShortcut shortcut)
Copies the given shortcut. |
boolean | init(String shortcut)
Initializes the key sequence with the given key sequence.
|
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isNull()
Returns true if the shortcut is null (after clear() or empty
constructor). |
int | keyCodeQt()
Returns the key code of the first key sequence, or
null if there is no first key sequence. |
static KShortcut | nil()
Returns a null shortcut. |
boolean | op_equals(KShortcut cut)
Compares the sequences of both shortcuts. |
boolean | op_lt(KShortcut cut)
Compares the sequences of both shortcuts. |
boolean | op_not_equals(KShortcut cut)
Compares the sequences of both shortcuts. |
void | remove(KKeySequence keySeq)
Removes the given key sequence from this shortcut |
KKeySequence | seq(int i)
Returns the i 'th key sequence of this shortcut. |
boolean | setSeq(int i, KKeySequence keySeq)
Sets the i 'th key sequence of the shortcut. |
String | toString()
Returns a description of the shortcut as semicolon-separated
ket sequences, as returned by KKeySequence.toString(). |
String | toStringInternal(KShortcut pcutDefault) |
String | toStringInternal() |
UNKNOWN: The maximum number of key sequences that can be contained in a KShortcut.
See Also: KShortcut KShortcut KShortcut
UNKNOWN: Creates a new null shortcut.
Parameters: keyQt the qt keycode
See Also: org.kde.qt.Qt#Key
UNKNOWN: Creates a new shortcut with the given Qt key code as the only key sequence.
Parameters: keySeq the qt key sequence to add
UNKNOWN: Creates a new shortcut that contains only the given qt key sequence.
Parameters: key the key to add
UNKNOWN: Creates a new shortcut that contains only the given key in its only sequence.
Parameters: keySeq the key sequence to add
UNKNOWN: Creates a new shortcut that contains only the given key sequence.
Parameters: shortcut the shortcut to add
UNKNOWN: Copies the given shortcut.
Parameters: shortcut the description of the key
See Also: (const
UNKNOWN: Creates a new key sequence that contains the given key sequence.
Parameters: keySeq the key sequence to add
Returns: true if successful, false otherwise
See Also: KShortcut
UNKNOWN: Appends the given key sequence.
Parameters: spec the key to add
Returns: true if successful, false otherwise
See Also: KShortcut MAX_SEQUENCES
UNKNOWN: Appends the given key
Parameters: cut the shortcut to append
Returns: true if successful, false otherwise
See Also: MAX_SEQUENCES
UNKNOWN: Appends the sequences from the given shortcut.
See Also: KShortcut
UNKNOWN: Clears the shortcut.
Parameters: shortcut the shortcut to compare to
Returns: a negative number if the given KShortcut is larger, 0 if they are equal and a positive number this KShortcut is larger
See Also: KKey KKeyShortcut#compare
UNKNOWN: Compares this object with the given shortcut.
Parameters: key the key to check
Returns: true if a key sequence starts with the key
UNKNOWN: Checks whether this shortcut contains a sequence that starts with the given key.
Parameters: keySeq the key sequence to check
Returns: true if the shortcut has the given key sequence
UNKNOWN: Checks whether this shortcut contains the given sequence.
Returns: the number of sequences MAX_SEQUENCES
UNKNOWN: Returns the number of sequences that are in this shortcut.
Parameters: keyQt the qt keycode
See Also: org.kde.qt.Qt#Key
UNKNOWN: Initializes the shortcut with the given Qt key code as the only key sequence.
Parameters: keySeq the qt key sequence to add
UNKNOWN: Initializes the shortcut with the given qt key sequence.
Parameters: key the key to add
UNKNOWN: Initializes the shortcut with the given key as its only sequence.
Parameters: keySeq the qt key sequence to add
UNKNOWN: Initializes the shortcut with the given qt key sequence.
Parameters: shortcut the shortcut to add
UNKNOWN: Copies the given shortcut.
Parameters: shortcut the description of the key
See Also: (const
UNKNOWN: Initializes the key sequence with the given key sequence.
Returns: true if the shortcut is null
UNKNOWN: Returns true if the shortcut is null (after clear() or empty constructor).
Returns: the key code of the first sequence's first key
See Also: org.kde.qt.Qt#Key KKeySequence
UNKNOWN: Returns the key code of the first key sequence, or null if there is no first key sequence.
Returns: the null shortcut
UNKNOWN: Returns a null shortcut.
See Also: KShortcut
UNKNOWN: Compares the sequences of both shortcuts.
See Also: KShortcut
UNKNOWN: Compares the sequences of both shortcuts.
See Also: KShortcut
UNKNOWN: Compares the sequences of both shortcuts.
Parameters: keySeq the key sequence to remove
UNKNOWN: Removes the given key sequence from this shortcut
i
'th key sequence of this shortcut.Parameters: i the number of the key sequence to retrieve
Returns: the i
'th sequence or KKeySequence.null() if
there are less than i
key sequences
MAX_SEQUENCES
UNKNOWN: Returns the i
'th key sequence of this shortcut.
i
'th key sequence of the shortcut. You can not introduce
gaps in the list of sequences, so you must use an i
<= count().
Also note that the maximum number of key sequences is MAX_SEQUENCES.Parameters: i the position of the new key sequence(0 <= i <= count(), 0 <= i < MAX_SEQUENCES) keySeq the key sequence to set
Returns: true if successful, false otherwise
UNKNOWN: Sets the i
'th key sequence of the shortcut.
Returns: the string represenation of this shortcut
See Also: KKey KKeySequence
UNKNOWN: Returns a description of the shortcut as semicolon-separated ket sequences, as returned by KKeySequence.toString().
UNKNOWN: