## Browsing with Amaya

Amaya is mainly an editor with browsing capabilities. It allows you to edit and browse Web documents simulteneously. Browsing with Amaya is similar to browsing with other Web browsers except for activating a Link and using forms.

Amaya allows you to to display and edit HTML documents as well as some XML document types: XHTML, MathML (mathematical expressions) and SVG (gaphics). It also allows you to access other XML document types and to display their content according to attached CSS style sheets. For these XML documents some editing functions are available.

### Activating a Link

Links are usually displayed as blue. Because Amaya is both a browser and an editor, you get different results when you single-click, double-click, or right-click a link.

- Single-click a link to move the cursor to that position in the document. The status bar displays the expanded URI of the link. You can now edit the content of the link.
- Double-click a link to activate the link and go to its target. The document retrieved by this operation replaces the current document in the same tab as the original document. If the original document was modified and has not yet been saved, a "Lose all modifications" prompt displays. It allows you to save save the changes you have made before the original document is replaced.
- Right-click a link to activate the link and open the target document in a new tab or a new window. The original document remains open in the first tab. You can choose to open the target document in a new tab or a new window by setting the corresponding option in the Browsing Preferences dialog under the Edit>Preferences menu.

This behavior can be changed through the Browsing Preferences dialog under the Edit>Preferences menu. By changing the Double click activates link option, you can browse documents with a single click as you would in a traditional Web browser. However, you will not be able to edit a link by clicking within it.
Other browsing preferences like the loading of images and the application of CSS can be controled in the Browsing Preferences dialog.

You can also use the keyboard to choose links and to activate them. Key `Tab` allows you to move to the next link or form field in the document. `Shift Tab` allows you to move to the previous link or form field. `Alt Enter` activates the current link. You can choose other keys to perform these commands.

### Access Keys

Access keys provide shortcuts for moving the cursor to a form field, an area, or a link. Such access can be crucial to people with motor disabilities, but there are other conditions where it could be necessary or useful.

When developing a web document, you can associate the `accesskey` attribute with the following elements: `A`, `AREA`, `BUTTON`, `INPUT`, `LABEL`, `LEGEND`, and `TEXTAREA`.

For example, if you associate the `accesskey` attribute with a link in a document using `accesskey="n"` or `accesskey="N"`, the command `Alt accesskey` (`Alt n` or `Alt N`) will activate that link. If you associate the `accesskey` attribute to a form element, pressing `Alt accesskey` moves the focus to that element (or to the following element if associated with a `LABEL` and `LEGEND` element).

Access keys overwrite Amaya shortcuts. For example, the Amaya Help pages declare these access keys:

- "n" for going to the next page
- "p" for going to the previous page
- "t" for the table of contents

If you have assigned the shortcut `Alt-p` to an Amaya command, this shortcut won't be accessible when the Amaya Help pages are displayed.

By default, Amaya uses the `Alt` key as the modifier for access keys. However, you can change this default using the Edit>Preferences>General dialog box. You can choose the `Control` key instead of the `Alt` key for a modifier, or you can disable the access keys handler.

### Target Anchors

Targets are elements that have been given an `ID` attribute or anchors (element a) that have been given an `name` attribute. They identify possible targets for links.

So that you can easily recognize targets, you can turn on the display of target icons . These icons are not part of the document and can be displayed or hidden in two ways:

- Choosing Show targets from the Views menu.
- Using default keyboard commands (`Ctrl v Ctrl t` in Unix, `Ctrl u Ctrl t` in Windows).

### Opening Documents

You can open both local or remote documents in several different ways:

File menu
  1. Choose Open document from the File menu.

     Note: You can alternately use a keyboard shortcut to open a document. Press `Ctrl o ctrl o`. You can also right-click the tab of any open document.

  2. In the Open document dialog, type the full path or URI of the file you want to open, or use the File or Directory buttons to open a file selection dialog.

     Note: You can also click the button on the right side of the address field to display the list of the documents you have opened recently. You can then select an address in this list to open the corresponding document.

  3. When the document is correctly specified, click Open.

  You can also use these steps to create a new local document, by specifying the name of a file that does not exist.

Document address field
  The address of the current document is displayed at the top of the window. Edit this address to specify the file name or the URI of the document you want to open and press ENTER.

  You can also create a new document by typing the name of a document that does not exist yet.

  Note: You can also click the button on the right side of the document address field to display the list of the documents you have opened recently. You can then select an address in this list to open the corresponding document.

Hypertext links
  By activating a link you load the target document.

Note about character sets

Amaya reads HTML and XHTML documents differently:

- Amaya reads HTML documents by default as ISO-Latin-1 files. If an author does not provide information about the character set (charset) in the HTTP header or in a META element, Amaya considers an HTML document to be encoded in ISO-Latin-1.

- Amaya reads XHTML documents by default as UTF-8 files. If an author does not provide information about the charset in the HTTP header, in the XML declaration, or in a META element, Amaya considers an XHTML document to be encoded in UTF-8.

Because the default charset is different for HTML and XHTML documents, authors often create documents using the incorrect charset. For example, consider an XHTML document that uses ISO-Latin-1 but does not provide information about the charset. When the XML parser analyzing the document encounters a character that does not match a valid UTF-8 character, the document is considered to be not well formed. Parsing stops and Amaya displays an error message that proposes either to reload the document as an HTML document or to show parsing errors. If show parsing errors is selected, Amaya displays the detected errors.

### Moving Backward and Forward

Amaya creates a history list to keep track of the pages you have viewed in the current session. You can move backward or forward through pages in the history list in several ways:

File menu | Choose Back from the File menu to view the previous page. Choose Forward from the File menu to view the next page.
Keyboard shortcuts | Unix: Press `Alt b` to view the previous page. Press `Alt f` to view the next page. Windows: Press `Ctrl b Ctrl b` to view the previous page. Press `Ctrl b Ctrl f` to view the next page.
Button bar | Click the button to view the previous page. Click the button to view the next page.

Note that each tab has a separate history.

### Reloading a page

Documents can be reloaded by:

- Choosing Reload document from the File menu.
- Using the shortcut `F5` in Unix and `Ctrl r` in Windows.
- Clicking the Reload button on the button bar.

## Using forms

As Amaya is a browser/editor, some of the widgets associated with HTML form elements are different from those you are used to in browsers. This section mentions the most notable differences.

### Simple menus

To activate a selector such as this one:
, you have to click twice on the entry ("apple" here). This will result in a popup widget appearing showing all the entries. The widget supports a user interaction both with the keyboard as well as with the mouse.

With the keyboard, you must first select an entry using the arrow keys. Pressing the Enter key validates the choice. You can abort the action of this widget by pressing the `Esc` key anytime.

With the mouse, there are two kinds of behavior. A single click allows you to select an entry, whereas a double click on an entry means that you want to activate the selection. To abort the action of the widget, you just need to click in any area outside of the pop-up widget. With very long menus, you can also use the scroll bar to quickly navigate thru the widget entries.

### Menus with multiple selections

Some menus, like this one :
allow multiple entries to be selected simultaneously. The behavior of this widget is similar to the single selection one. That is, the widget supports only one toggle of a selection state at the time. You need to invoke it as many times as toggle changes you need. When the widget is activated, it shows the current state of selections. As before, you can abort the widget by using either the `Esc` key or clicking elsewhere.