KConfig 5.109.0
Classes | Enumerations | Functions
KStandardShortcut Namespace Reference

Convenient methods for access to the common accelerator keys in the key configuration. More...

Classes

class  StandardShortcutWatcher
 Watches for changes made to standard shortcuts and notifies about those changes. More...
 

Enumerations

enum class  Category {
  InvalidCategory = -1 , File , Edit , Navigation ,
  View , Settings , Help
}
 Categories in which the standard shortcuts can be classified. More...
 
enum  StandardShortcut {
  AccelNone = 0 , Open , New , Close ,
  Save , Print , Quit , Undo ,
  Redo , Cut , Copy , Paste ,
  PasteSelection , SelectAll , Deselect , DeleteWordBack ,
  DeleteWordForward , Find , FindNext , FindPrev ,
  Replace , Home , Begin , End ,
  Prior , Next , Up , Back ,
  Forward , Reload , BeginningOfLine , EndOfLine ,
  GotoLine , BackwardWord , ForwardWord , AddBookmark ,
  ZoomIn , ZoomOut , FullScreen , ShowMenubar ,
  TabNext , TabPrev , Help , WhatsThis ,
  TextCompletion , PrevCompletion , NextCompletion , SubstringCompletion ,
  RotateUp , RotateDown , OpenRecent , SaveAs ,
  Revert , PrintPreview , Mail , Clear ,
  ActualSize , FitToPage , FitToWidth , FitToHeight ,
  Zoom , Goto , GotoPage , DocumentBack ,
  DocumentForward , EditBookmarks , Spelling , ShowToolbar ,
  ShowStatusbar , SaveOptions , KeyBindings , Preferences ,
  ConfigureToolbars , ConfigureNotifications , TipofDay , ReportBug ,
  SwitchApplicationLanguage , AboutApp , AboutKDE , DeleteFile ,
  RenameFile , MoveToTrash , Donate , ShowHideHiddenFiles ,
  CreateFolder , StandardShortcutCount
}
 Defines the identifier of all standard accelerators. More...
 

Functions

const QList< QKeySequence > & addBookmark ()
 Add current page to bookmarks.
 
const QList< QKeySequence > & back ()
 Back.
 
const QList< QKeySequence > & backwardWord ()
 BackwardWord.
 
const QList< QKeySequence > & begin ()
 Go to beginning of the document.
 
const QList< QKeySequence > & beginningOfLine ()
 Go to beginning of current line.
 
Category category (StandardShortcut id)
 Returns the appropriate category for the given StandardShortcut id.
 
const QList< QKeySequence > & close ()
 Close current document.
 
const QList< QKeySequence > & completion ()
 Complete text in input widgets.
 
const QList< QKeySequence > & copy ()
 Copy selected area into the clipboard.
 
const QList< QKeySequence > & createFolder ()
 Create a folder.
 
const QList< QKeySequence > & cut ()
 Cut selected area and store it in the clipboard.
 
const QList< QKeySequence > & deleteFile ()
 Permanently delete files or folders.
 
const QList< QKeySequence > & deleteWordBack ()
 Delete a word back from mouse/cursor position.
 
const QList< QKeySequence > & deleteWordForward ()
 Delete a word forward from mouse/cursor position.
 
const QList< QKeySequence > & end ()
 Go to end of the document.
 
const QList< QKeySequence > & endOfLine ()
 Go to end of current line.
 
const QList< QKeySequence > & find ()
 Initiate a 'find' request in the current document.
 
StandardShortcut find (const char *keyName)
 Return the StandardShortcut id of the standard accel action which has keyName as its name, or AccelNone if none of them do.
 
StandardShortcut find (const QKeySequence &keySeq)
 Return the StandardShortcut id of the standard accel action which uses this key sequence, or AccelNone if none of them do.
 
StandardShortcut findByName (const QString &name)
 Return the StandardShortcut id of the standard accelerator action which has name as its name, or AccelNone if none of them do.
 
const QList< QKeySequence > & findNext ()
 Find the next instance of a stored 'find' Default: F3.
 
const QList< QKeySequence > & findPrev ()
 Find a previous instance of a stored 'find'.
 
const QList< QKeySequence > & forward ()
 Forward.
 
const QList< QKeySequence > & forwardWord ()
 ForwardWord.
 
const QList< QKeySequence > & fullScreen ()
 Full Screen Mode.
 
const QList< QKeySequence > & gotoLine ()
 Go to line.
 
QList< QKeySequence > hardcodedDefaultShortcut (StandardShortcut id)
 Returns the hardcoded default shortcut for id.
 
const QList< QKeySequence > & help ()
 Help the user in the current situation.
 
const QList< QKeySequence > & home ()
 Go to home page.
 
QString label (StandardShortcut id)
 Returns a localized label for user-visible display.
 
const QList< QKeySequence > & moveToTrash ()
 Moves files or folders to the trash.
 
QString name (StandardShortcut id)
 Returns a unique name for the given accel.
 
const QList< QKeySequence > & next ()
 Scroll down one page.
 
const QList< QKeySequence > & nextCompletion ()
 Iterate through a list when completion returns multiple items.
 
const QList< QKeySequence > & open ()
 Open file.
 
const QList< QKeySequence > & openNew ()
 Create a new document (or whatever).
 
const QList< QKeySequence > & paste ()
 Paste contents of clipboard at mouse/cursor position.
 
const QList< QKeySequence > & pasteSelection ()
 Paste the selection at mouse/cursor position.
 
const QList< QKeySequence > & preferences ()
 Opens the app's settings window.
 
const QList< QKeySequence > & prevCompletion ()
 Iterate through a list when completion returns multiple items.
 
const QList< QKeySequence > & print ()
 Print current document.
 
const QList< QKeySequence > & prior ()
 Scroll up one page.
 
const QList< QKeySequence > & quit ()
 Quit the program.
 
const QList< QKeySequence > & redo ()
 Redo last operation.
 
const QList< QKeySequence > & reload ()
 Reload.
 
const QList< QKeySequence > & renameFile ()
 Rename files or folders.
 
const QList< QKeySequence > & replace ()
 Find and replace matches.
 
const QList< QKeySequence > & rotateDown ()
 Help users iterate through a list of entries.
 
const QList< QKeySequence > & rotateUp ()
 Help users iterate through a list of entries.
 
const QList< QKeySequence > & save ()
 Save current document.
 
void saveShortcut (StandardShortcut id, const QList< QKeySequence > &newShortcut)
 Saves the new shortcut cut for standard accel id.
 
const QList< QKeySequence > & selectAll ()
 Select all.
 
const QList< QKeySequence > & shortcut (StandardShortcut id)
 Returns the keybinding for accel.
 
StandardShortcutWatchershortcutWatcher ()
 Returns the global KStandardShortcutWatcher instance of this program.
 
const QList< QKeySequence > & showHideHiddenFiles ()
 Shows or hides hidden files.
 
const QList< QKeySequence > & showMenubar ()
 Show Menu Bar.
 
const QList< QKeySequence > & substringCompletion ()
 Find a string within another string or list of strings.
 
const QList< QKeySequence > & tabNext ()
 Next Tab.
 
const QList< QKeySequence > & tabPrev ()
 Previous Tab.
 
const QList< QKeySequence > & undo ()
 Undo last operation.
 
const QList< QKeySequence > & up ()
 Up.
 
const QList< QKeySequence > & whatsThis ()
 What's This button.
 
QString whatsThis (StandardShortcut id)
 Returns an extended WhatsThis description for the given accelerator.
 
const QList< QKeySequence > & zoomIn ()
 Zoom in.
 
const QList< QKeySequence > & zoomOut ()
 Zoom out.
 

Detailed Description

Convenient methods for access to the common accelerator keys in the key configuration.

These are the standard keybindings that should be used in all KDE applications. They will be configurable, so do not hardcode the default behavior.

Enumeration Type Documentation

◆ Category

enum class KStandardShortcut::Category
strong

Categories in which the standard shortcuts can be classified.

Since
5.74

◆ StandardShortcut

Defines the identifier of all standard accelerators.

Enumerator
Open 

Open file.

New 

Create a new document.

Close 

Close current document.

Save 

Save current document.

Print 

Print current document.

Quit 

Quit the program.

Undo 

Undo last operation.

Redo 

Redo last operation.

Cut 

Cut selected area and store it in the clipboard.

Copy 

Copy selected area into the clipboard.

Paste 

Paste contents of clipboard at mouse/cursor position.

PasteSelection 

Paste the selection at mouse/cursor position.

SelectAll 

Select all.

Deselect 

Deselect any selected elements.

DeleteWordBack 

Delete a word back from mouse/cursor position.

DeleteWordForward 

Delete a word forward from mouse/cursor position.

Find 

Initiate a 'find' request in the current document.

FindNext 

Find the next instance of a stored 'find'.

FindPrev 

Find a previous instance of a stored 'find'.

Replace 

Find and replace matches.

Home 

Go to home page.

Begin 

Go to beginning of the document.

End 

Go to end of the document.

Prior 

Scroll up one page.

Next 

Scroll down one page.

Up 

Up.

Back 

Back.

Forward 

Forward.

Reload 

Reload.

BeginningOfLine 

Go to beginning of current line.

EndOfLine 

Go to end of current line.

GotoLine 

Go to line.

BackwardWord 

BackwardWord.

ForwardWord 

ForwardWord.

AddBookmark 

Add current page to bookmarks.

ZoomIn 

Zoom in.

ZoomOut 

Zoom out.

FullScreen 

Full Screen mode.

ShowMenubar 

Show Menu Bar.

TabNext 

Next Tab.

TabPrev 

Previous Tab.

Help 

Help the user in the current situation.

WhatsThis 

What's This button.

TextCompletion 

Complete text in input widgets.

PrevCompletion 

Iterate through a list when completion returns multiple items.

NextCompletion 

Iterate through a list when completion returns multiple items.

SubstringCompletion 

Find a string within another string or list of strings.

RotateUp 

Help users iterate through a list of entries.

RotateDown 

Help users iterate through a list of entries.

OpenRecent 

Open a recently used document.

SaveAs 

Save the current document under a different name.

Revert 

Revert the current document to the last saved version.

PrintPreview 

Show a print preview of the current document.

Mail 

Send the current document by mail.

Clear 

Clear the content of the focus widget.

ActualSize 

View the document at its actual size.

FitToPage 

Fit the document view to the size of the current window.

FitToWidth 

Fit the document view to the width of the current window.

FitToHeight 

Fit the document view to the height of the current window.

Zoom 

Select the current zoom level.

Goto 

Jump to some specific location in the document.

GotoPage 

Go to a specific page.

DocumentBack 

Move back (document style menu).

DocumentForward 

Move forward (document style menu).

EditBookmarks 

Edit the application bookmarks.

Spelling 

Pop up the spell checker.

ShowToolbar 

Show/Hide the toolbar.

ShowStatusbar 

Show/Hide the statusbar.

SaveOptions 
Deprecated:
since 5.39
KeyBindings 

Display the configure key bindings dialog.

Preferences 

Display the preferences/options dialog.

ConfigureToolbars 

Display the toolbar configuration dialog.

ConfigureNotifications 

Display the notifications configuration dialog.

TipofDay 

Display the "Tip of the Day".

ReportBug 

Display the Report Bug dialog.

SwitchApplicationLanguage 

Display the Switch Application Language dialog.

AboutApp 

Display the application's About dialog.

AboutKDE 

Display the About KDE dialog.

DeleteFile 

Permanently delete files or folders.

Since
5.25
RenameFile 

Rename files or folders.

Since
5.25
MoveToTrash 

Move files or folders to the trash.

Since
5.25
Donate 

Open donation page on kde.org.

Since
5.26
ShowHideHiddenFiles 

Toggle showing or hiding hidden files.

Since
5.70
CreateFolder 

Create a folder.

Since
5.74

Function Documentation

◆ addBookmark()

const QList< QKeySequence > & KStandardShortcut::addBookmark ( )

Add current page to bookmarks.

Default: Ctrl+B

Returns
the shortcut of the standard accelerator

◆ back()

const QList< QKeySequence > & KStandardShortcut::back ( )

Back.

Default: Alt+Left

Returns
the shortcut of the standard accelerator

◆ backwardWord()

const QList< QKeySequence > & KStandardShortcut::backwardWord ( )

BackwardWord.

Default: Ctrl+Left

Returns
the shortcut of the standard accelerator

◆ begin()

const QList< QKeySequence > & KStandardShortcut::begin ( )

Go to beginning of the document.

Default: Ctrl-Home

Returns
the shortcut of the standard accelerator

◆ beginningOfLine()

const QList< QKeySequence > & KStandardShortcut::beginningOfLine ( )

Go to beginning of current line.

Default: Home

Returns
the shortcut of the standard accelerator

◆ category()

Category KStandardShortcut::category ( StandardShortcut  id)

Returns the appropriate category for the given StandardShortcut id.

Since
5.73

◆ close()

const QList< QKeySequence > & KStandardShortcut::close ( )

Close current document.

Default: Ctrl-w

Returns
the shortcut of the standard accelerator

◆ completion()

const QList< QKeySequence > & KStandardShortcut::completion ( )

Complete text in input widgets.

Default Ctrl+E

Returns
the shortcut of the standard accelerator

◆ copy()

const QList< QKeySequence > & KStandardShortcut::copy ( )

Copy selected area into the clipboard.

Default: Ctrl-c

Returns
the shortcut of the standard accelerator

◆ createFolder()

const QList< QKeySequence > & KStandardShortcut::createFolder ( )

Create a folder.

Default: F10

Returns
the shortcut of the standard accelerator
Since
5.74

◆ cut()

const QList< QKeySequence > & KStandardShortcut::cut ( )

Cut selected area and store it in the clipboard.

Default: Ctrl-x

Returns
the shortcut of the standard accelerator

◆ deleteFile()

const QList< QKeySequence > & KStandardShortcut::deleteFile ( )

Permanently delete files or folders.

Default: Shift+Delete

Returns
the shortcut of the standard accelerator
Since
5.25

◆ deleteWordBack()

const QList< QKeySequence > & KStandardShortcut::deleteWordBack ( )

Delete a word back from mouse/cursor position.

Default: Ctrl-Backspace

Returns
the shortcut of the standard accelerator

◆ deleteWordForward()

const QList< QKeySequence > & KStandardShortcut::deleteWordForward ( )

Delete a word forward from mouse/cursor position.

Default: Ctrl-Delete

Returns
the shortcut of the standard accelerator

◆ end()

const QList< QKeySequence > & KStandardShortcut::end ( )

Go to end of the document.

Default: Ctrl-End

Returns
the shortcut of the standard accelerator

◆ endOfLine()

const QList< QKeySequence > & KStandardShortcut::endOfLine ( )

Go to end of current line.

Default: End

Returns
the shortcut of the standard accelerator

◆ find() [1/3]

const QList< QKeySequence > & KStandardShortcut::find ( )

Initiate a 'find' request in the current document.

Default: Ctrl-f

Returns
the shortcut of the standard accelerator

◆ find() [2/3]

StandardShortcut KStandardShortcut::find ( const char *  keyName)

Return the StandardShortcut id of the standard accel action which has keyName as its name, or AccelNone if none of them do.

This is used by class KKeyChooser.

Parameters
keyNamethe key sequence to search
Returns
the id of the standard accelerator, or AccelNone if there is none
Deprecated:
since 5.71, use findByName(const QString &name) instead

◆ find() [3/3]

StandardShortcut KStandardShortcut::find ( const QKeySequence &  keySeq)

Return the StandardShortcut id of the standard accel action which uses this key sequence, or AccelNone if none of them do.

This is used by class KKeyChooser.

Parameters
keySeqthe key sequence to search
Returns
the id of the standard accelerator, or AccelNone if there is none

◆ findByName()

StandardShortcut KStandardShortcut::findByName ( const QString &  name)

Return the StandardShortcut id of the standard accelerator action which has name as its name, or AccelNone if none of them do.

Parameters
namethe name as returned by name(StandardShortcut id)
Returns
the id of the standard accelerator with the given name or AccelNone if there is no such accelerator
Since
5.71

◆ findNext()

const QList< QKeySequence > & KStandardShortcut::findNext ( )

Find the next instance of a stored 'find' Default: F3.

Returns
the shortcut of the standard accelerator

◆ findPrev()

const QList< QKeySequence > & KStandardShortcut::findPrev ( )

Find a previous instance of a stored 'find'.

Default: Shift-F3

Returns
the shortcut of the standard accelerator

◆ forward()

const QList< QKeySequence > & KStandardShortcut::forward ( )

Forward.

Default: ALT+Right

Returns
the shortcut of the standard accelerator

◆ forwardWord()

const QList< QKeySequence > & KStandardShortcut::forwardWord ( )

ForwardWord.

Default: Ctrl+Right

Returns
the shortcut of the standard accelerator

◆ fullScreen()

const QList< QKeySequence > & KStandardShortcut::fullScreen ( )

Full Screen Mode.

Default: Ctrl+Shift+F

Returns
the shortcut of the standard accelerator

◆ gotoLine()

const QList< QKeySequence > & KStandardShortcut::gotoLine ( )

Go to line.

Default: Ctrl+G

Returns
the shortcut of the standard accelerator

◆ hardcodedDefaultShortcut()

QList< QKeySequence > KStandardShortcut::hardcodedDefaultShortcut ( StandardShortcut  id)

Returns the hardcoded default shortcut for id.

This does not take into account the user's configuration.

Parameters
idthe id of the accelerator
Returns
the default shortcut of the accelerator

◆ help()

const QList< QKeySequence > & KStandardShortcut::help ( )

Help the user in the current situation.

Default: F1

Returns
the shortcut of the standard accelerator

◆ home()

const QList< QKeySequence > & KStandardShortcut::home ( )

Go to home page.

Default: Alt-Home

Returns
the shortcut of the standard accelerator

◆ label()

QString KStandardShortcut::label ( StandardShortcut  id)

Returns a localized label for user-visible display.

Parameters
idthe id of the accelerator
Returns
a localized label for the accelerator

◆ moveToTrash()

const QList< QKeySequence > & KStandardShortcut::moveToTrash ( )

Moves files or folders to the trash.

Default: Delete

Returns
the shortcut of the standard accelerator
Since
5.25

◆ name()

QString KStandardShortcut::name ( StandardShortcut  id)

Returns a unique name for the given accel.

Parameters
idthe id of the accelerator
Returns
the unique name of the accelerator

◆ next()

const QList< QKeySequence > & KStandardShortcut::next ( )

Scroll down one page.

Default: Next

Returns
the shortcut of the standard accelerator

◆ nextCompletion()

const QList< QKeySequence > & KStandardShortcut::nextCompletion ( )

Iterate through a list when completion returns multiple items.

Default: Ctrl+Down

Returns
the shortcut of the standard accelerator

◆ open()

const QList< QKeySequence > & KStandardShortcut::open ( )

Open file.

Default: Ctrl-o

Returns
the shortcut of the standard accelerator

◆ openNew()

const QList< QKeySequence > & KStandardShortcut::openNew ( )

Create a new document (or whatever).

Default: Ctrl-n

Returns
the shortcut of the standard accelerator

◆ paste()

const QList< QKeySequence > & KStandardShortcut::paste ( )

Paste contents of clipboard at mouse/cursor position.

Default: Ctrl-v

Returns
the shortcut of the standard accelerator

◆ pasteSelection()

const QList< QKeySequence > & KStandardShortcut::pasteSelection ( )

Paste the selection at mouse/cursor position.

Default: Ctrl-Shift-Insert

Returns
the shortcut of the standard accelerator

◆ preferences()

const QList< QKeySequence > & KStandardShortcut::preferences ( )

Opens the app's settings window.

Default: Ctrl+Shift+Comma

Returns
the shortcut of the standard accelerator
Since
5.64

◆ prevCompletion()

const QList< QKeySequence > & KStandardShortcut::prevCompletion ( )

Iterate through a list when completion returns multiple items.

Default: Ctrl+Up

Returns
the shortcut of the standard accelerator

◆ print()

const QList< QKeySequence > & KStandardShortcut::print ( )

Print current document.

Default: Ctrl-p

Returns
the shortcut of the standard accelerator

◆ prior()

const QList< QKeySequence > & KStandardShortcut::prior ( )

Scroll up one page.

Default: Prior

Returns
the shortcut of the standard accelerator

◆ quit()

const QList< QKeySequence > & KStandardShortcut::quit ( )

Quit the program.

Default: Ctrl-q

Returns
the shortcut of the standard accelerator

◆ redo()

const QList< QKeySequence > & KStandardShortcut::redo ( )

Redo last operation.

Default: Shift-Ctrl-z

Returns
the shortcut of the standard accelerator

◆ reload()

const QList< QKeySequence > & KStandardShortcut::reload ( )

Reload.

Default: F5

Returns
the shortcut of the standard accelerator

◆ renameFile()

const QList< QKeySequence > & KStandardShortcut::renameFile ( )

Rename files or folders.

Default: F2

Returns
the shortcut of the standard accelerator
Since
5.25

◆ replace()

const QList< QKeySequence > & KStandardShortcut::replace ( )

Find and replace matches.

Default: Ctrl-r

Returns
the shortcut of the standard accelerator

◆ rotateDown()

const QList< QKeySequence > & KStandardShortcut::rotateDown ( )

Help users iterate through a list of entries.

Default: Down

Returns
the shortcut of the standard accelerator

◆ rotateUp()

const QList< QKeySequence > & KStandardShortcut::rotateUp ( )

Help users iterate through a list of entries.

Default: Up

Returns
the shortcut of the standard accelerator

◆ save()

const QList< QKeySequence > & KStandardShortcut::save ( )

Save current document.

Default: Ctrl-s

Returns
the shortcut of the standard accelerator

◆ saveShortcut()

void KStandardShortcut::saveShortcut ( StandardShortcut  id,
const QList< QKeySequence > &  newShortcut 
)

Saves the new shortcut cut for standard accel id.

◆ selectAll()

const QList< QKeySequence > & KStandardShortcut::selectAll ( )

Select all.

Default: Ctrl-A

Returns
the shortcut of the standard accelerator

◆ shortcut()

const QList< QKeySequence > & KStandardShortcut::shortcut ( StandardShortcut  id)

Returns the keybinding for accel.

On X11, if QApplication was initialized with GUI disabled, the default keybinding will always be returned.

Parameters
idthe id of the accelerator

◆ shortcutWatcher()

StandardShortcutWatcher * KStandardShortcut::shortcutWatcher ( )

Returns the global KStandardShortcutWatcher instance of this program.

In addition to the notifying about changes it also keeps the information returned by the functions in KStandardShortcut up to date. The object is created by the first call to this function.

Since
5.91

◆ showHideHiddenFiles()

const QList< QKeySequence > & KStandardShortcut::showHideHiddenFiles ( )

Shows or hides hidden files.

Defaults: Ctrl+H, Alt+.

Returns
the shortcut of the standard accelerator
Since
5.70

◆ showMenubar()

const QList< QKeySequence > & KStandardShortcut::showMenubar ( )

Show Menu Bar.

Default: Ctrl-M

Returns
the shortcut of the standard accelerator

◆ substringCompletion()

const QList< QKeySequence > & KStandardShortcut::substringCompletion ( )

Find a string within another string or list of strings.

Default: Ctrl-T

Returns
the shortcut of the standard accelerator

◆ tabNext()

const QList< QKeySequence > & KStandardShortcut::tabNext ( )

Next Tab.

Default: Ctrl-<

Returns
the shortcut of the standard accelerator

◆ tabPrev()

const QList< QKeySequence > & KStandardShortcut::tabPrev ( )

Previous Tab.

Default: Ctrl->

Returns
the shortcut of the standard accelerator

◆ undo()

const QList< QKeySequence > & KStandardShortcut::undo ( )

Undo last operation.

Default: Ctrl-z

Returns
the shortcut of the standard accelerator

◆ up()

const QList< QKeySequence > & KStandardShortcut::up ( )

Up.

Default: Alt+Up

Returns
the shortcut of the standard accelerator

◆ whatsThis() [1/2]

const QList< QKeySequence > & KStandardShortcut::whatsThis ( )

What's This button.

Default: Shift+F1

Returns
the shortcut of the standard accelerator

◆ whatsThis() [2/2]

QString KStandardShortcut::whatsThis ( StandardShortcut  id)

Returns an extended WhatsThis description for the given accelerator.

Parameters
idthe id of the accelerator
Returns
a localized description of the accelerator

◆ zoomIn()

const QList< QKeySequence > & KStandardShortcut::zoomIn ( )

Zoom in.

Default: Ctrl-Plus

Returns
the shortcut of the standard accelerator

◆ zoomOut()

const QList< QKeySequence > & KStandardShortcut::zoomOut ( )

Zoom out.

Default: Ctrl-Minus

Returns
the shortcut of the standard accelerator