Ctrl plus U not clearing location bar in Mozilla
From FVue
Contents |
Problem
Ctrl+U doesn't clear the location bar in Mozilla. Mozilla used to care if the cursor was in the location bar. If so, and I pressed Ctrl+U, the preceding portion of the location bar text would be cleared, just as I'm used from bash. After I upgraded to SuSE 9.3 and Mozilla 1.7.7 Ctrl+U always shows the page source, even when the cursor is in the location bar.
Solution
Mozilla and Firefox are both written with the GTK graphical engine. Some time ago it was decided by Mozilla to remove the 'Emacs' keys behaviour. You can now use global GTK settings to reinstate 'Emacs' key behaviour for all GTK applications, including Mozilla and Firefox.
GNOME
The GNOME desktop is written with the GTK graphical engine. Issue this command:
gconftool-2 -s -t string /desktop/gnome/interface/gtk_key_theme "Emacs"
See also: Keyboard shortcuts: Faster than the speed of mouse
On Xubuntu, go to Keyboard Preferences and select "Emacs" as the Keyboard map.
KDE
The KDE desktop is written with the Qt graphical engine. Under KDE it takes some more effort to make GTK-applications like Mozilla listen to global GTK settings:
1. deinstall any gtk-qt-engine possibly running.
2. install control-center2, the Gnome Control Center
3. set the GTK key theme to 'Emacs':
gconftool-2 -s -t string /desktop/gnome/interface/gtk_key_theme "Emacs"
4. load the GNOME configuration this session:
/opt/gnome/bin/gnome-keybinding-properties
5. load the Gnome configuration every time KDE is started:
ln -s /opt/gnome/lib/control-center-2.0/gnome-settings-daemon /home/user/.kde/Autostart
NOTE: Now that the GNOME Control Center settings are applied after KDE is started, mouse and screensaver settings are controlled by GNOME instead of KDE:
- To change the mouse settings, run
gnomeccor { Start | Utilities | Desktop | GNOME Control Center }. Doubleclick on Mouse and modify the mouse settings from here. - To change screensaver settings, run
XScreenSaverorgnoneccif gnome-screensaver is installed.
Shortcuts
So now — whenever the cursor is in a textarea or textfield, e.g. the browser location bar — these shortcuts take precedence above the ones from Mozilla:
| action
key +-----------------------------------------+------------------
| gtk_key_theme 'Emacs' | Mozilla
-------+-----------------------------------------+------------------
CTRL+A | Move cursor to begin of line | Select all
CTRL+B | Move cursor backwards one character | Bookmark manager
CTRL+C | --> | Copy
CTRL+D | Delete; delete character under cursor | --
CTRL+E | Move cursor to end of line | Edit page
CTRL+F | Move cursor forward one character | Find in this page
CTRL+G | --> | Find again
CTRL+H | Backspace | History
CTRL+I | --> | Page info
CTRL+J | -- | --
CTRL+K | Delete from cursor to end of line | --
CTRL+L | --> | Focus location bar
CTRL+M | --> | New message
CTRL+N | Next line | New navigator window
CTRL+O | --> | Open file
CTRL+P | Previous line | Print
CTRL+Q | --> | Quit
CTRL+R | --> | Reload
CTRL+S | --> | Save page as
CTRL+T | --> | New navigator tab
CTRL+U | Delete from cursor to begin of line | View source
CTRL+V | --> | Paste
CTRL+W | Delete current word until previous word | Close tab
CTRL+X | --> | Cut
CTRL+Y | Redo | --
CTRL+Z | Undo | --
Journal
20050811
Mozilla Keyboard Shortcuts is not mentioning my Ctrl+U location bar behaviour?
20050811
Someone facing the same problem in Firefox Re: Firefox, I want my ctrl-u back
20050811
A solution is offered on Dumbbell's home: Ctrl+U with Mozilla and Firefox:
20051228
The thread GNOME v. KDE, December 2005 edition hints the possibility to set the gtk_key_theme in KDE by running /opt/gnome/lib/GConf/2/gconfd-2.
The thread Firefox Ctrl-U n text entry field - solved! seems to offer a solution.
I do have a directory /usr/share/themes, but it is empty?
Created a ~./gtkrc-2.0:
gtk-key-theme-name="Emacs" include "/opt/gnome/share/themes/Emacs/gtk-2.0-key/gtkrc"
but it has no effect in KDE.
After I executed gnome-keybinding-properties, CTRL-U suddenly works in both Mozilla and Firefox (after restarting them). This process appears in my job list:
/opt/gnome/lib/control-center-2.0/gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_SettingsDaemon --oaf-ior-fd=31
Let's restart the session... Now the desired CTRL-U behaviour is gone.
Surfed from Howto:gtk/gnome Apps Under Kde - SuSE Linux Forums to SuSELinuxSupport: HowToGTKGnomeAppsunderKDE. Uninstalled gtk-qt-engines which apparently bypassed my .gtkrc-2.0.
20060630
After the above fix, the Gnome screensaver keeps appearing. Found out it can be disabled via {Configuration Editor}:
|- apps
|- gnome-settings-daemon
|- screensaver

