This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Super-speedy KDE keyboard shortcuts

By Joe 'Zonker' Brockmeier on May 26, 2006 (8:00:00 AM)

Share    Print    Comments   

One of the reasons that I prefer using Vim to a word processor or GUI application is that my hands rarely need to leave the keyboard. I can do all my copying and pasting using Vim keybindings. When it comes to my window manager, I try to do the same thing -- work with tools that let me use the keyboard to navigate as much as possible without having to use the mouse. If you use KDE, you can save quite a bit of time by becoming familiar with all of KDE's shortcuts.

KDE's shortcuts are very configurable, and KDE ships with several different shortcut schemes based on other OSes or window managers. KDE can emulate Mac OS X shortcuts, Windows, Unix, and WindowMaker, and it has its own shortcut schemes based on having three or four modifier keys. So -- depending on the scheme that you choose -- the shortcut to cycle through windows might be Alt-Tab, Ctrl-Tab, or Alt-F11. The functions remain the same, but you may find that your actual shortcut key is different than one discussed here. When in doubt, consult the Keyboard Shortcuts application to see which keys are assigned to a particular shortcut.

By the way, you'll see a lot of references to keybindings, hotkeys, and shortcuts, but in this context they're all referring to the same thing -- key combinations that allow you to do something quickly. KDE's documentation uses the term "shortcuts" throughout, so that's what I'll stick to. Also, the features described in this article are current as of KDE 3.5.2 -- your mileage may vary if you're running older or newer versions of KDE.

When you open the Keyboard Shortcuts module, you can select one of the default schemes from a dropdown menu, or leave it on the current scheme. You might want to create a new scheme rather than tweak the existing scheme; you can do this after you've made a change by clicking the Save button and assigning a name to the new scheme. The text file with the Scheme is saved under ~/.kde/share/apps/kcmkeys, in case you want to transfer your shortcuts to a new system.

To get to the KDE Control Module for shortcuts, go to the KDE menu and select Settings -> Regional & Accessibility -> Keyboard Shortcuts. Once you're in the module, you'll see tabs for Global Shortcuts, Shortcut Sequences, and Application Shortcuts under the Shortcut Schemes tab.

Global shortcuts and shortcut sequences

Let's start by looking at KDE's global shortcuts, which control global KDE actions, like manipulating windows and cycling through desktops. You'll find these under the Global Shortcuts and Shortcut Sequences tabs. You're probably already familiar with some of the shortcuts, such as using Alt-Tab to cycle through windows, or Ctrl-Tab if you're a Mac user. But KDE makes it possible to do so much more than that.

For example, one shortcut that I use frequently is the Alt-F2 shortcut to launch the Run Command dialog. If I want to launch a program that has a short, easy-to-type name, it's usually easier for me to just hit Alt-F2 and type the name of the command (like gimp or pysol) and then start using that program than to stop using the keyboard and navigate to the menu or taskbar using the mouse.

If you use multiple workspaces, you can assign shortcuts to move through the workspaces without having to click on the KDE pager window. For example, I have Ctrl-F1 through Ctrl-F4 assigned to workspaces one through four under the Shortcut Sequences tab, so pressing Ctrl-F2 changes the focus from whatever desktop I am using to desktop two. I keep browser windows open on workspace one, my mail client open in workspace two, a VMware instance open in workspace three, and so forth.

Sometimes, I want a window to be visible on all desktops, so I have Ctrl-Shift-Alt-A set to the Keep Window on All Desktop shortcut. This comes in handy for IRC and Jabber. Another handy action is Show Window List, which pops up a dialog with all the open windows across all desktops -- you can get the same dialog by using the middle mouse button on the KDE desktop. This doesn't come with a default shortcut, so I set it to Alt-l. I just hit Alt-l and then use the arrow keys to select the window I want to bring to focus.

Did you know you can move your windows within KDE without touching the mouse at all? Press Win-_ or Alt-F5, and you can move the window around with the arrow keys instead of the mouse. I also have Alt-F6 set to resize the window using the keyboard. Just press Alt-F6 and a small arrow pops up on the lower right corner of the window. The up and down arrows increase and decrease the window size.

If you're security-conscious, you'll probably want to get to know the Lock Session shortcut. This will blank the screen and require you to enter your user password before you can resume your KDE session. The default shortcut for this one is Alt-Ctrl-l. This is a good one to use regularly if you work in a multiuser environment, particularly if you have mischievous co-workers.

KDE has too many global shortcuts to describe them all. Take a few minutes to browse through the lists and try some of the actions to see what they do.

By the way, don't worry about overwriting existing shortcuts. KDE will warn you if you try to set a shortcut that already exists, and give you the choice of overriding the current shortcut or setting a different shortcut.

Application shortcuts

Application shortcuts are the shortcuts used within applications, such as Ctrl-v for paste, Ctrl-c for copy, and Ctrl-s to save a file. The Keyboard Shortcut application allows you to set a shortcut for actions within applications so that the same shortcut will work across applications. So, if Ctrl-r makes more sense to you for the redo function -- as opposed to Ctrl-Shift-z, which is the default in KDE -- then you can simply change the keys used for that operation.

However, the application shortcuts are a bit limited. They apply only to KDE applications, which is to say that if you change the keys used for Add Bookmark, it will work within KDE apps like Konqueror, but it won't affect Firefox's shortcut for adding a bookmark. However, since Firefox and KDE use different defaults for adding bookmarks (Ctrl-d for Firefox, Ctrl-b for Konqueror) you could change KDE's default to match Firefox's if you're more familiar with Firefox.

The application shortcuts exposed in the Keyboard Shortcuts application apply only to functions found in most KDE apps, so you may need to set or modify some shortcuts within specific applications. For example, the Detach Session function in Konsole can only be set through Konsole's Configure Shortcuts dialog -- presumably because few KDE apps actually have a "detach" function. For KDE applications with configurable shortcuts, you can get to the dialog through the Settings -> Configure Shortcuts menus.

Speaking of application shortcuts, there's a Konqueror feature that many KDE users may not be familiar with. When you're using Konqueror as a Web browser, if you press Ctrl it will pop up a bunch of yellow squares with letters and numbers next to the links. Press the letter or number next to the link you're interested in, and Konqueror will load that URI. This function isn't quite perfect yet -- on some sites, Konqueror doesn't seem to recognize every link, and if links are crowded together, it's sometimes difficult to sort out which number or letter is connected to a given link. However, it can be really useful most of the time.

Window shortcuts

Window shortcuts are key combos that bring a specific window into focus. You can use Alt-Tab or the window menu to navigate through all of your open windows, or you can set a shortcut for the application windows you use regularly. For example, I usually set a shortcut of Win-t to bring my Konsole session into focus without having to sort through any of the other applications that may be open.

To set a window-specific shortcut, click on the top left corner of the window you want to set the shortcut for (or press Alt-F3), and select Advanced -> Window Shortcut. This will bring up a dialog that will allow you to specify a shortcut for that window.

The downside with setting the shortcut for a window is that KDE forgets the setting once you close the window. So, if you set Ctrl-Alt-F as a shortcut for Firefox, that will last only as long as the Firefox window remains open.

To make the setting permanent, go back to the window menu (Alt-F3) and select Advanced -> Special Application Settings. Then select the Preferences tab, check Shortcut, and select Remember from the pulldown menu to the right. Enter the shortcut you'd like to use in the box to the right of the pulldown menu. After you've saved the settings, you'll be able to use the shortcut every time you open the application.

Launching applications

In the Keyboard Shortcuts module, you'll see a tab for Command Shortcuts. These allow you to set shortcuts to launch an application rather than having to use the menu or click on a panel icon to start the application.

KDE doesn't come with any command shortcuts preset by default. You can assign any application in the KDE menu a keyboard shortcut that will launch the application. Just select the application and click the Custom radio button at the bottom of the Command Shortcuts tab. Since I use the Win key for little else, I usually assign applications a Win+mnemonic key -- such as Win-c for the calculator application, Win-d for the dictionary application, and so forth.

The only real complaint that I have with KDE's shortcuts is that KDE doesn't allow you to assign non-standard keys to launch applications or run commands. For example, I have a Logitech ergonomic keyboard with a bunch of "media" keys that aren't recognized by applications or KDE. I can use xbindkeys to program them, but it would be much nicer if KDE would let me set the "Home" key at the top of the keyboard to launch Konqueror in my home directory, or the "Run" key to start the Run Application dialog.

According to the help text, I should be able to remap my modifier keys in the Keyboard Shortcuts Modifier Keys tab, but this doesn't work. This is a shame, because I bet a lot of people would like an easy way to remap the Caps Lock key to something more useful -- like a second Control key.

Summary

KDE exposes a great deal of functionality through its shortcuts. Take a little time to set up a workable shortcut scheme that fits your work habits, and you'll find yourself shaving time off of repetitive tasks that you do every day.

The difference in time between using the mouse to select a window or using the keyboard may be small, but it adds up. Also, many people complain that switching between a keyboard and mouse over and over again during a normal workday tends to aggravate or contribute to repetitive strain injury (RSI). Since this is a real concern for many computer users, it's worthwhile to learn how to avoid RSI while still being able to spend the time necessary at the computer to get the job done.

Share    Print    Comments   

Comments

on Super-speedy KDE keyboard shortcuts

Note: Comments are owned by the poster. We are not responsible for their content.

Media keys

Posted by: Anonymous Coward on May 26, 2006 11:50 PM
The only real complaint that I have with KDE's shortcuts is that KDE doesn't allow you to assign non-standard keys to launch applications or run commands. For example, I have a Logitech ergonomic keyboard with a bunch of "media" keys that aren't recognized by applications or KDE.


KDE is not at fault for not seeing your media keys. You need to select an appropriate keyboard layout in the KDE control centre. The keyboard layouts you'll see listed are the domain of XKB.

If you don't see your specific model of keyboard listed you can try a similar model. Many of the Logitech XKB layouts in the latest Xorg include a common set of media keys so you have a good chance of finding one that works.

#

How to Assign shortcuts to "Konsole inputs"?

Posted by: Anonymous Coward on May 27, 2006 12:08 AM
Ive tried and Tried
how do I shortcut a input sequence in the Konsole. Im trying to automate my user-password sequence to access some servers by telnet, but I hadnt success.

Is it possible?

#

Re:How to Assign shortcuts to "Konsole inputs"?

Posted by: Anonymous Coward on May 27, 2006 02:03 AM
The normal way of doing this is with 'expect' scripts. Just google for expect and you should be able to come up with some example scripts.

Bo Thorsen.

#

Re:How to Assign shortcuts to "Konsole inputs"?

Posted by: Anonymous Coward on May 27, 2006 02:19 AM
First of all, you do not want to connect to servers using telnet. Secondly, you do not want to set some keyboard shortcut to you username and password.

Do it right using passwordless authentication, see for example

<a href="http://www.linux.com/article.pl?sid=05/12/02/2045226" title="linux.com">http://www.linux.com/article.pl?sid=05/12/02/2045<nobr>2<wbr></nobr> 26</a linux.com>

#

Re:How to Assign shortcuts to "Konsole inputs"?

Posted by: Anonymous Coward on May 30, 2006 10:13 PM
I have the feeling he's talking about attaching to things like MUDs, MUCKs and MOOs (or telnet BBSes). They usually use telnet, and don't offer ssh or anything more secure. If someone swipes your password... well, it's only a game and/or conversation.

#

Good article

Posted by: Anonymous Coward on May 29, 2006 12:55 PM
Good article, thanks. Its good to be reminded of hidden and/or forgotten features now and again.



Two questions. First, is it possible to print out (on paper) all the default key bindings for Kde, without having to print a screenshot of the keybindings? Is there any text list of the keybindings? It would be very handy to have that list available, next to the monitor or hanging on a nearby wall or on the side of the tower for reference from time to time. Especially when a service crashes or the computer is very busy and you can't or don't have time to pull up the screen showing the keybindings.



Second, the keybindings have turned into a helpful crutch for me for when kwin crashes. When kwin crashes, the top of each window disappears (and some functionality fails) so there is no way to drag the window, resize it, open new tabs in konqueror, use the kicker panel, etc. Is there any way to restart kwin when kwin crashes, without restarting X? Losing kwin is a nightmare sometimes because of the number of open konqueror tabs and windows I usually have open, in addition to the other apps like Kmail which has to be shut down by killing the process when kwin crashes instead of cleanly shutting it down, and so on. Restarting X means I lose all the tabs/windows I had open, I lose the ssh shells open to servers I was monitoring, I possibly lose some emails because kmail wasn't shut down cleanly, etc. And to top it off, if running one of my usual desktops, the computer shuts completely down when restarting X because I'm running knoppix from the cd instead of Debian from the hard drive. So kwin crashing means a total reboot for me if I can't get kwin working again.

#

Re:Good article

Posted by: Anonymous Coward on May 30, 2006 12:34 AM
Second, the keybindings have turned into a helpful crutch for me for when kwin crashes. When kwin crashes, the top of each window disappears (and some functionality fails) so there is no way to drag the window, resize it, open new tabs in konqueror, use the kicker panel, etc. Is there any way to restart kwin when kwin crashes, without restarting X?


I have managed before to restart kwin by pressing Alt-F2 or Win-Return to bring up the Run Command dialogue. When that hasn't worked I switched to a text console (i.e. Ctrl-Alt-F2), logged in as the same user ran the following commands:

<tt>$ DISPLAY=:0.0 kwin &
$ disown</tt>

#

More confusion on kwin

Posted by: Anonymous Coward on May 30, 2006 09:25 AM
what is the command you use to restart kwin when alt-f2 works?



When I was able to open a shell while in X, I've tried "kwin &", "/etc/init.d/kwin" (there isn't an<nobr> <wbr></nobr>/etc/init.d/kwin) among others and none work. Taking a look at top when its showing parent process numbers, kwin runs from kdeinit. I don't recall if "kwin" or "kwin &" at the command line results in just an empty prompt, or an error message asking for which display...



Either way, I've been able to get a bash shell while in X, I've been able to get alt-f2 to work (at least for a short while), and I've been able to switch to a console using ctrl-alt-f3, f4, f2, etc. At the consoles, I wasn't sure on the command for which display to use, but what you posted looks like it will work, I'll print it out and keep it handy. What's the exact command to use if alt-f2 works, or if I can get a bash shell while in X? From what I recall, I couldn't get alt-f2 to work, but getting the bash shell was possible, at least as a separate tab to an already open shell.



Thanks!

#

Re:Good article

Posted by: Anonymous Coward on May 30, 2006 05:30 AM
One way to avoid losing your logins to the other servers is to use GNU screen. I usually have one screen session per server (with multiple shells within each, for multiple connections to each server) which I can access within konsole when I'm at work, and which I can re-attach in a regular SSH session from home (or any other PC at work).

#

What to do when kwin crashes

Posted by: Anonymous Coward on February 22, 2007 02:54 AM
Before kwin crashes an entry in K Menu should be created:

1) Enter 'kwin' (without brackets) in 'Command' field.
2) Assign a keyboard shortcut for this entry in 'Current shortcut key' field (for example, Win+K).
3) You don't have to fill other fields. Just save this entry.

Next time, when kwin crashes you just have to press Win+K and kwin process should start again.

I hope it will help.

#

nice article, thank you

Posted by: Anonymous Coward on May 27, 2006 12:55 AM
good stuff, Zonker! What's the world coming to- first us cranky grammarians insist on correct spelling and punctuation, and now here you are blatantly promoting skilled typing. My, my.<nobr> <wbr></nobr>:)

--
Carla the cranky grammarian

#

Some further tips

Posted by: Anonymous Coward on May 27, 2006 02:12 AM
Good article, I'm using KDE too with everything mapped to a key.
One handy thing to remember is, that the so-called "windows key" is pretty useless in Linux.. well is it? Instead of binding Alt or some hard to remember four letter key combo to an action, just bind Super+AnyKey to it.
Also, in addition to the mentioned tips, don't forget to keybind maximize window, roll/hide window and stuff to a keybinding.

#

Key / Mouse Combos

Posted by: Anonymous Coward on May 27, 2006 04:43 AM
What I really miss about KDE shortcuts is the ability to define mouseclicks or key/click combos in the same way as pure keyboard shortcuts. For example, I can redefine shortcuts back and forth in kmplayer, but I cannot say that I want to use double click as a fullscreen toggle.

#

Caps Lock

Posted by: Anonymous Coward on May 27, 2006 07:09 AM
You can remap Caps Lock using xmodmap; if you map it to a new modifier (an unnamed modifier, such as modifier 4), you might be able to use it without running the risk of shadowing existing shortcuts. At least this is possible in FVWM 2.

#

needs standards

Posted by: Anonymous Coward on May 31, 2006 02:32 AM
Keyboard shortcuts are nice. But what Linux really would need was a standard built-in way for the xserver to toggle full-screen on and off. I go nuts on my Ubuntu when I play games that steal mouse focus, i have to learn Metacity- and game and Wine specific fullscreen shortcuts or use etswitch etc.

That actually was one of the things that usually worked on Win98 as far as I remember.

#

Strange actions

Posted by: Anonymous Coward on June 01, 2006 04:53 PM
While KDE key shortcut are nice sometimes the actions are weird: I have a very usefull shortcut to iconify all windows, but I switches to another workspace and come back all the iconified windows are not iconified anymore, which is very annoying..

Anyone knows how to change this behaviour?
Or is-it a bug specific to RHE3?

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya