Interacción por teclado

10.2.1. Navegación por teclado

A well-designed keyboard user interface plays a key role when you are designing applications. Many power-users prefer to perform most operations with the keyboard rather than the mouse. Visually-impaired users can navigate software more effectively using the keyboard, because using the mouse depends on visual feedback of the mouse pointer location. And mobility impairments can prevent a user from successfully navigating using the mouse, because of the fine motor control skills required.

Make all mouse actions available from the keyboard, and include keyboard access to all toolbars, menus, links and buttons. Every function your application provides must be available using the keyboard alone. Hiding your mouse while you test your application is a great way to test this!

Figura 10-4Dialog and menu, with some of their access and shortcut keys indicated

Most functionality is easy to make available from the keyboard, by using access keys and shortcut keys, and the toolkit's built-in keyboard navigation features. All controls with labels should have access keys, and frequently-used menu items should be assigned shortcut keys. However, operations that rely on drag-and-drop, for example, may require more thought to make them keyboard accessible.

Guías
  • Provide efficient keyboard access to all application features. In particular, ensure every control on menus and in dialogs are directly focusable using access keys or shortcut keys.
  • Use a logical keyboard navigation order. When navigating around a window with the Tab key, keyboard focus should move between controls in a predictable order. In Western locales, this is normally left to right and top to bottom.
  • Ensure correct tab order for controls whose enabled state is dependent on check box, radio button or toggle button state. When such a button is selected, all its dependent controls should be enabled, and all the dependent controls of any other button in the group should be disabled. When the user selects a check box, radio button or toggle button that has dependent controls, do not automatically give focus to the first dependent control, but instead leave the focus on the button.
  • Do not over-ride existing system-level accessibility features. For example, the MouseKeys feature in the GNOME Keyboard Accessibility preferences dialog allows mouse movement and button clicks to be simulated using the keypad. Therefore you cannot add features to your application that can only be accessed by pressing keys on the keypad, as users relying on the MouseKeys feature will not be able to use them.
  • Ensure that any text that can be selected with the mouse can also be selected with the keyboard. This is a convenience for all users, but especially for those for whom fine control of the mouse is difficult.
  • Ensure that objects that can be resized or moved by drag and drop can also be resized or moved with the keyboard. For example, icons and windows on the desktop. Where precision sizing and placement is potentially important, e.g. shapes in a diagram, also consider providing a dialog into which you can type co-ordinates, or a means of snapping objects to a user-definable grid.
  • Do not use general navigation functions to trigger operations. For example, do not use basic Tab keyboard navigation in a dialog to activate any actions associated with a control.
  • Show keyboard-invoked menus, windows and tooltips near the object they relate to, but without hiding or obscuring the object to which the menu or tooltip refers,. In GNOME, popup menus are activated with Shift+F10, and tooltips with Ctrl+F1.
  • Provide more than one method to perform keyboard tasks where possible. Users may find some keys and key combinations easier to use than others.
  • Do not assign awkward reaches to frequently performed keyboard operations. Some people may only be able to use one hand on the keyboard, so shortcuts that can be easily used with one hand are preferable for common operations. In any case, having to frequently perform long or difficult reaches on the keyboard can increase muscle strain for all users, increasing the risk of pain or injury.
  • Do not require repetitive use of simultaneous keypresses. Some users are only able to press and hold one key at a time. Assistive technologies such as the GNOME Keyboard Accessibility preferences dialog do allow users to press the keys sequentially rather than simultaneously, but this of course means the operation will take longer for them.

10.2.2. Choosing Access Keys

Give all labelled components an access key (underlined letter), with the exception of toolbar controls which would use up too many access key combinations.

Choose access keys to be as easy to remember as possible. Normally, this means using the first letter of the label. However, in complex windows, the choice can become more difficult. Here are some simple rules:

  1. Assign access keys to the most frequently-used controls first. If it's not clear which controls will be the most frequently used, assign access keys from left to right, top to bottom (for Western locales).
  2. Use the first letter of the label, or of one of its other words if it has more than one. If another letter provides a better association (e.g. "x" in Extra Large) however, consider using that letter instead.
  3. If the first letter is not available, choose an easy to remember consonant from the label, for example, "p" in Replace.
  4. If no such consonants are available, choose any available vowel from the label.

If duplication of access keys in a window is unavoidable, you should still refrain from duplicating the access keys for any of these buttons that appear in the same window: OK, Cancel, Close, Apply or Help.

Also, it is better not to assign access keys to "thin" letters (such as lowercase i or l), or letters with descenders (such as lowercase g or y) unless it is unavoidable. The underline does not show up very well on those characters in some fonts.

Applications using a non-Roman writing system in conjunction with a standard keyboard can have control labels prefixed with Roman characters as access keys.

10.2.3. Choosing Shortcut Keys

The tables in Sección 10.2.4: Standard Application Shortcut Keys summarize the standard shortcut keys to use when your application supports those functions. Your application will not necessarily support all of these functions, see Sección 4.4: Menús estándar for more information. However, use the recommended shortcut keys for those functions you do support.

You will probably want to add your own shortcut keys for functions specific to your application. If so, as well as following the guidelines below, look at any other existing similar applications to see which shortcut keys they have defined. Your users may already be using those or similar applications, so being consistent where it is possible and sensible to do so will provide a better user experience for them when they begin to use yours.

Guías
  • Use Ctrl+letter in preference to other combinations when choosing new shortcut keys.
  • Insert, Delete, Home, End, Page Up and Page Down are acceptable shortcut keys for functions that are closely related to those keys' normal system-defined uses. Do not assign them to unrelated functions just because you've run out of other shortcut key combinations, however.
  • Only assign shortcut keys to the most commonly-used actions in your application. Do not try to assign a shortcut key to everything.
  • Choose new shortcut keys to be as mnemonic as possible, as these will be easier to learn and remember. For example, Ctrl+E would be a good shortcut for a menu item called Edit Page.
  • Use Shift+Ctrl+letter for functions that reverse or extend another function. For example, Ctrl+Z and Shift+Ctrl+Z for Undo and Redo.
    Unicode entry shortcuts

    Note that you cannot use Shift+Ctrl+A-thru-F or Shift+Ctrl+0-thru-9 for your own purposes, as these combinations are used to enter unicode characters in text fields.

  • Do not use Ctrl+number or numbered function keys as shortcut keys, unless the number has some obvious relevance to the action. For example, Ctrl+2 and Ctrl+3 may be acceptable shortcut keys for View ▸ 2D View and View ▸ 3D View in a 3D modelling application.
  • Do not use Alt+key combinations for shortcut keys, as these may conflict with window manager or menu access keys.
  • Do not use symbols that require Shift or other modifiers as part of a shortcut, for example Ctrl+%. Remember that symbols that can be accessed without a modifier key on your keyboard may be more difficult to access on different international keyboards.
  • Do not assign shortcut keys to menu items that change over time, for example a list of open windows on the Window menu, or a recently-used file list on the File menu. Do assign access keys to these items, however.
  • Do not use any of the standard shortcut keys listed in Sección 10.2.4: Standard Application Shortcut Keys for your own purposes, even if your application doesn't support those functions. This helps reinforce consistency between all GNOME applications.

10.2.4. Standard Application Shortcut Keys

If your application uses any of the standard functions listed in the following tables, use the recommended standard keyboard shortcut for that function.

Tabla 10-5Standard GNOME application shortcut keys and access keys - File menu
Función Combinación de teclas Descripción
New Ctrl+N Crear un documento nuevo
Open Ctrl+O Abrir un documento
Save Ctrl+S Guardar el documento actual
Print Ctrl+P Imprimir el documento actual
Close Ctrl+W Cerrar el documento actual
Quit Ctrl+Q Sale de la aplicación
Tabla 10-6Standard GNOME application shortcut keys and access keys - Edit menu
Función Combinación de teclas Descripción
Undo Ctrl+Z Deshacer la última operación
Redo Mayús+Ctrl+Z Rehacer la última operación
Cut Ctrl+X Cut the selected area and store it in the clipboard
Copy Ctrl+C Copy the selected area into the clipboard
Paste Ctrl+V Paste contents of clipboard at mouse/cursor position
Duplicate Ctrl+U Duplicate the currently-selected items and add them to the same window, without affecting the clipboard
Select All Ctrl+A Select everything in focused control or window
Invert Selection Ctrl+I Select everything in focused control or window that was previously unselected, and deselect everything that was previously selected
Delete Supr Eliminar la selección
Find... Ctrl+F Find matches in the current document, highlighting them in-place
Search... Ctrl+F (see note below) Search for matches in multiple documents, files or other external sources
Find Next Ctrl+G Buscar siguiente coincidencia
Replace... Ctrl+H Buscar y reemplazar coincidencias
Rename F2 Switch the selected item's label into edit mode, allowing user to type in a new name.
Find and Search

If your application requires both Edit ▸ Find and Edit ▸ Search menu items, use Shift+Ctrl+F as the shortcut for Search.

Tabla 10-7Standard GNOME application shortcut keys and access keys - View menu
Función Combinación de teclas Descripción
Zoom In Ctrl+Más Zoom in on the document
Zoom Out Ctrl+Menos Zoom out of the document
Normal Size Ctrl+0 Restore to zoom level to normal size (generally 100%)
Refresh Ctrl+R Redraw current view of document, without checking if content has changed
Reload Ctrl+R (see note below) Reload the current document, updating content from source if necessary
Properties Alt+Intro Display the selected object's Properties window. May alternatively appear on the Archivo menu if the document itself is the only object in the application whose properties can be inspected.
Recargar y actualizar

If your application requires both View ▸ Reload and View ▸ Refresh menu items, use Shift+Ctrl+R as the shortcut for Reload.

Tabla 10-8Teclas de acceso rápido y atajos de teclado estándar de GNOME: Menú marcadores
Función Combinación de teclas Descripción
Añadir marcador B Ctrl+D Añade un marcador para la ubicación actual
Editar marcadores... E Ctrl+B (see note below) Abrir una ventana en la que el usuario puede editar y organizar los marcadores guardados
Resaltar y editar marcadores

Si su aplicación requiere los elementos de menú Formatear ▸ Resaltar y Marcadores ▸ Editar marcadores..., use Mayús+Ctrl+D como atajo para Editar marcadores.

Tabla 10-9Standard GNOME application shortcut keys and access keys - Go menu
Función Combinación de teclas Descripción
Back Alt+Izquierda Ir a la siguiente ubicación en la cadena de navegación
Siguiente x Alt+Derecha Ir a la siguiente ubicación en la cadena de navegación
Up Alt+Arriba Go up one level in the navigation hierarchy
Home Alt+Inicio Go to the starting page defined by the user or application
Location... Ctrl+L Present or focus an entry field into which the user can type a new address or location to view
Tabla 10-10Standard GNOME application shortcut keys and access keys - Format menu
Función Combinación de teclas Descripción
Bold Ctrl+B Cambiar el texto seleccionado actualmente a negrita/normal
Underline Ctrl+U Underline/remove underline from selected text
Italic Ctrl+I Cambiar el texto seleccionado actualmente a cursiva/normal
Tabla 10-11Standard GNOME application shortcut keys and access keys - Help menu
Función Combinación de teclas Descripción
Contents F1 Show help contents page for the current application

10.2.4.1. Standard Window Manager Shortcut Keys

The following shortcut keys are used by many window managers, and should not normally be over-ridden by your application.

Tabla 10-12Teclas rápidas y de acceso para el gestor de ventanas estándar
Función Combinación de teclas Descripción
Cambiar las ventanas principales Alt+Tabulador, Mayús+Alt+Tabulador Cambiar el foco la siguiente o anterior ventana de nivel superior del escritorio
Cambiar paneles Ctrl+Alt+Tabulador, Mayús+Ctrl+Alt+Tabulador Cambiar el foco al siguiente o anterior panel en el escritorio
Salir de la sesión Ctrl+Alt+Supr Abrir el diálogo de confirmación de cierre de sesión
Menú de ventana Alt+Espacio Abrir el menú de ventana
Close Alt+F4 Cerrar la ventana con el foco
Restaurar R Alt+F5 Restaurar lo que tiene el foco a su tamaño anterior
S con ventanas secundarias Alt+F6, Mayús+Alt+F6 Cambiar el foco al siguiente o anterior ventana secundaria asociada con la aplicación ()
Mover M Alt+F7 Mover la ventana con el foco
Redimensionar s Alt+F8 Redimensionar la ventana con el foco
Minimizar n Alt+F9 Minimizar la ventana que tenga el foco
Maximizar x Alt+F10 Maximizar la ventana que tenga el foco
F pantalla completa Ctrl+F11 Mostrar la ventana en modo a pantalla completa, sin borde, barra de menú, barra de herramientas o barra de estado

10.2.4.2. Teclas rápidas de navegación estándar para los widgets

The following shortcut keys are reserved for keyboard navigation use by the various widgets used in GNOME, and should not normally be over-ridden by your application.

Tabla 10-13Teclas de navegación estándar de GNOME para widgets
Clave Función
Tabulador, Mayús+Tabulador Mueve el foto del teclado al siguiente/anterior control
Ctrl+Tabulador, Mayús+Ctrl+Tabulador Moves keyboard focus out of enclosing widget to next/previous control, in those situations where Tab alone has another function (e.g. GtkTextView)
Ctrl+F1 Mostrar el consejo para el control actualmente seleccionado
Mayús+F1 Mostrar la ayuda sensible a contexto para la ventana o control actualmente con el foco
F6, Mayús+F6 Dar el foco al siguiente/anterior panel en una ventana GtkPaned
F8 Dar el foco a la barra agrupadora en la ventana del panel
F10 Dar el foco a la barra de menú de la ventana
Mayús+F10 Muestra el menú contextual emergente para los objetos actualmente seleccionados
Espacio Conmutar el estado de la casilla de verificación, botón de radio o botón de conmutación con el foco
Intro Activar el botón con el foco, el elemento del menú, etc.
Inicio, Fin Seleccionar/moverse al primer elemento en el widget seleccionado
RePág, Ctrl+RePág, AvPág, Ctrl+AvPág Desplazar una página la vista seleccionada arriba/izquierda/abajo/derecha

10.2.4.3. Teclas rápidas de navegación adicionales para los widgets

The following emacs-style navigation shortcut keys are still available in GNOME 2.0 text entry fields (by selecting the "emacs" scheme in the GNOME Keyboard Shortcuts preferences dialog), but are disabled by default. Since some users will still want to use them, do not over-ride them for your own purposes in any situations where a text entry control has focus.

Tabla 10-14Teclas de navegación estilo Emacs para los widgets
Clave Función
Ctrl+A Mover el cursor al principio de la línea
Ctrl+D Borrar el carácter siguiente/bajo el cursor
Ctrl+E Mover el cursor al final de la línea
Ctrl+K Borrar desde el cursor al final de la línea
Ctrl+U Borrar la línea actual
Ctrl+W Cortar al portapapeles
Ctrl+Y Pega desde el portapapeles
Ctrl+Espacio Establecer marca
Ctrl+Supr, Alt+D Borrar desde el cursor al final de la palabra
Ctrl+Retroceso Borrar desde el cursor al principio de la palabra
Alt+Espacio Elimine todo espacio en blanco alrededor del cursor, reinserte un solo espacio en blanco
Alt+\ Borrar todos los espacios en blanco alrededor del cursor

10.2.5. Interacción del teclado con las aplicaciones del panel (miniaplicaciones)

Panels have been fully keyboard navigable since GNOME 2.0. Since your panel application can gain keyboard focus, you must ensure that it is also keyboard navigable.

Las reglas para la navegación por teclado de las aplicaciones del panel son básicamente las mismas que para otra ventana. No obstante existe una diferencia importante:

  • No use la tecla Tab para mover el foco entre los controles de una aplicación del panel. En su lugar, use las teclas de flechas para este propósito.

When an object on a panel has focus, the Tab key normally moves focus to the next object on the panel. If your panel application also used Tab for its own internal navigation, the user would have to press Ctrl+Tab to move focus out of your panel application instead. This inconsistency would be detrimental to the user experience.