Input.ini settings
It is possible to configure keyboard actions for different contexts within Opera by editing the input.ini file. The contexts are hierarchically ordered, which means that if the currently-focused context does not have a handler for a specific key, the key event is passed on to the parent context.
Action strings
The action strings are in the format:
'Key value' = 'Action value', "argument string"
Key value
The key values are represented by the ASCII character of the key, or a string identifier for system keys. The key may have modifiers such as Alt, Shift, and Ctrl, as well as combinations of these.
Example: "g ctrl alt" will be activated when the keys Ctrl, Alt, and G are pressed at the same time.
Examples of valid system key values are as follows: "Space", "Right", "Left", "Down", "Up", "Backspace", "Enter", "PageUp", "PageDown", "Home", "End", "Esc", "Ins", "Del", "F1", and "F2". The values are not case sensitive.
Actions
The action value is a string that directs the action to take when the key is pressed. Examples of actions are as follows:
Value | Comment |
---|---|
Back | Back in history |
Forward | Forward in history |
Navigate left/right/up/down | Navigate left/right/up/down in the document |
Scroll left/right/up/down | Scroll the current frame left/right/up/down |
Go, "<url>" | Go the URL provided as the argument |
Go to homepage | Go to the predefined home page |
Zoom in | Zoom in |
Zoom out | Zoom out |
Reload | Reload the current page |
Stop | Stop the current page loading |
External Action, "<action name>", "<action parameters>" | External action that can be caught in the embedding API (see below) |
For a more complete list of action values, see below.
Argument string
Some actions take argument strings. (see External Action below)
Multiple actions per key value
It is possible to trigger several actions at once with a single keystroke. It is also possible to set up keys so that they alternate between two different actions. This is illustrated below with a few examples:
[Dropdown Widget] Ctrl Space = Select item & Unfocus form
This action will select the currently highlighted element in the drop-down list and then unfocus the drop-down list. This saves the user from having to first select the item and then leave the drop-down.
[Checkbox Widget] Space = Check item | Uncheck item
With this declaration, the space button will either check or uncheck the item, depending on the context. The situations where this is possible, or not possible, should be intuitive.
External Action signal
The "External Action" event can be used for a user-defined action. Two argument strings may be passed along with the action. The first one is a name, so that the application can identify the appropriate action to take. The second argument is a string with additional parameters for the action. The "External Action" signal can only be added in the [Browser Window] context, but it will be triggered if a child of the [Browser Window] context is focused.
Example:
To send "action name" and the parameter string "action parameters" to the External Action callback when ctrl-s is pressed, add the folllowing line:
s ctrl = External Action, "action name", "action parameters"
Mouse gestures
It is possible to map mouse gestures to different actions by modifying the file input.ini. For more information about mouse gestures, see the Mouse gestures section.
The input contexts
The contexts are hierarchically ordered. When a key is pressed, a search for a matching action is started from the currently-focused context. If a context does not specify an action for the key, its parent context is searched. Once an action is found, the context to handle the action must be determined. The contexts from the currently-focused context to the context where the action was specified are searched. The first context with a handler for the action is selected and its handler is triggered. Thus it is possible for the parent to specify actions that affect its child contexts, and for the child contexts to override those actions.
Browser Window
The [Browser Window] context is the topmost context in the context hierarchy. It handles actions that modify the contents of the window. The following actions are defined for the [Browser Widget] context:
Value | Comment |
---|---|
Back | Go back in history |
Forward | Go forward in history |
Stop | Stop loading of the current document. |
Reload | Reload the current document. |
Go, "<url>" | Go to the URL provided as the argument. |
Go to homepage | Go to the home page. |
External Action, "<action name>", "<action parameters>" | For more information, see external actions in this section. |
Browser Widget
The [Browser Widget] is the generally the next in the context hierarchy. Many actions related to navigation are handled here. The following actions are defined for the [Browser Widget] context:
Value | Comment |
---|---|
Activate element | This will do different things depending on the focused element, including the following:. Links will be opened in the current page. Text areas and input fields will be entered allowing input. The drop-down list will be navigated into, and require an additional "Show Dropdown" action to allow selection. Buttons will be pressed. |
Navigate left | Navigate to the element left of the current focus. |
Navigate right | Navigate to the element right of the current focus. |
Navigate up | Navigate to the element over of the current focus. |
Navigate down | Navigate to the element below the current focus. |
Focus form | Focus/Enter the current focused element. |
Unfocus form | Unfocus/Leave the current focused element. |
Highlight next URL | Navigate to the next link in the document. |
Highlight previous URL | Navigate to the previous link in the document. |
Highlight next heading | Navigate to the next heading in the document. |
Highlight previous heading | Navigate to the previous heading in the document. |
Open link | Open the currently-focused link. |
Open link in new page | Open the currently-focused link in a new page. |
Zoom in, "<scale>" | Zoom in the current document with the amount according to the scale. |
Zoom out, "<scale>" | Zoom out the current document with the amount according to the scale. |
Zoom to, "<scale>" | Zoom the current document to the scale given in the argument. |
Focus next widget | Navigate to the next input widget in the document. |
Focus previous widget | Navigate to the previous input widget in the document. |
Scrollable container
The [Scrollable Container] can be a browser widget, but also a DIV element or a text area element. It accepts actions related to scrolling. The following actions are defined for the [Scrollable Container] context:
Value | Comment |
---|---|
Go to start | Scroll to the start of the content. |
Go to end | Scroll to the end of the content. |
Scroll right | |
Scroll left | |
Scroll down | |
Scroll up | |
Page up | Scroll one page up |
Page down | Scroll one page down |
Page left | Scroll one page left |
Page right | Scroll one page right |
There are several other contexts that may be modified. These have predefined settings and an embedder rarely needs to redefine them, however, they are listed here for clarity:
Form
Value | Comment |
---|---|
Focus next radio widget | Focus the next radio widget in the form. |
Focus previous radio widget | Focus the previous radio widget in the form. |
Button Widget
Value | Comment |
---|---|
Click button |
Checkbox Widget
Value | Comment |
---|---|
Check item | |
Uncheck item |
Dropdown Widget
Value | Comment |
---|---|
Show dropdown | Expand the drop-down list. |
Close dropdown | Compress the drop-down list. |
Select item | Select the currently-highlighted element. |
Next item | Go to the next element. |
Previous item | Go to the previous element. |
Go to start | Go to the first element in the list. |
Go to end | Go to the last element in the list. |
Unfocus form | Leave the selection mode. |
Edit Widget
Value | Comment |
---|---|
Previous character | |
Next character | |
Range previous character | |
Range next character | |
Range previous word | |
Range next word | |
Previous line | |
Next line | |
Range previous line | |
Range next line | |
Page up | |
Page down | |
Range page up | |
Range page down | |
Go to line start | |
Go to line end | |
Range go to line start | |
Range go to line end | |
Go to start | |
Go to end | |
Range go to start | |
Range go to end | |
Delete word | |
Backspace | |
Left adjust text | |
Right adjust text | |
Next word | |
Previous word | |
Backspace word | |
Select all | Select all text. |
Clear | Clear all input. |
Insert | Insert the selected text. |
Cut | Cut the selected text to clipboard. |
Copy | Copy the selected text to clipboard. |
Paste | Paste the text from clipboard. |
List Widget
Value | Comment |
---|---|
Next item | |
Previous item | |
Range next item | |
Range previous item | |
Page up | |
Page down | |
Range page up | |
Range page down | |
Go to start | |
Go to end | |
Range go to start | |
Range go to end | |
Unfocus form | Leave the selection mode. |
Radiobutton Widget
Value | Comment |
---|---|
Click button |