Skip to content

Commit

Permalink
Merge pull request #679 from o-sdn-o/gui-bridge
Browse files Browse the repository at this point in the history
Change `Exclusive Keyboard Mode` to `Alternate Keyboard Mode`
  • Loading branch information
o-sdn-o authored Nov 11, 2024
2 parents e3a71b5 + ad85902 commit 238bdd0
Show file tree
Hide file tree
Showing 17 changed files with 403 additions and 313 deletions.
26 changes: 18 additions & 8 deletions doc/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ The list of hotkey actions is slightly different from the list of window menu ac

Value | Unique for hotkeys | Default Hotkey | Description
-----------------------------|--------------------|------------------------------|------------
Drop | | | Drop all events for the specified key combination. No further processing.
DropIfRepeats | | | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
ToggleExclusiveKeybd | x | `Ctrl-Alt`, `Alt-Ctrl` | Toggle exclusive keyboard mode. In exclusive mode, all keyboard events are ignored by higher levels.
Drop | x | | Drop all events for the specified key combination. No further processing.
DropAutoRepeat | x | | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
ToggleHotkeyMode | x | `Ctrl-Alt`, `Alt-Ctrl` | Toggle hotkey mode between mode=0 (deafult) and mode=1.
TerminalFindNext | | `Alt+RightArrow` | Highlight next match of selected text fragment. Clipboard content is used if no active selection.
TerminalFindPrev | | `Alt+LeftArrow` | Highlight previous match of selected text fragment. Clipboard content is used if no active selection.
TerminalViewportOnePageUp | x | `Shift+Ctrl+PageUp` | Scroll one page up.
Expand Down Expand Up @@ -303,11 +303,23 @@ TerminalSelectionOneShot | |
</notes>
</item>
</menu>
<hotkeys key*> <!-- The required key combination sequence can be generated on the Info page, accessible by clicking on the label in the lower right corner of the vtm desktop. -->
</term>
<hotkeys> <!-- The required key combination sequence can be generated on the Info page, accessible by clicking on the label in the lower right corner of the vtm desktop. -->
<tui key*> <!-- TUI matrix layer key bindings. The mode=0 is implicitly used by default. -->
<key="Space-Backspace" action=ToggleDebugOverlay/> <!-- Toggle debug overlay. -->
<key="Backspace-Space" action=ToggleDebugOverlay/> <!-- Toggle debug overlay (reversed release order). -->
<key="Ctrl-Alt" action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=1 by pressing and releasing Ctrl-Alt. -->
<key="Alt-Ctrl" action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=1 by pressing and releasing Alt-Ctrl (reversed releasing). -->
<key="Ctrl-Alt" mode=1 action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=0 (default) by pressing and releasing Ctrl-Alt. -->
<key="Alt-Ctrl" mode=1 action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=0 (default) by pressing and releasing Alt-Ctrl (reversed releasing). -->
</tui>
<term key*>
<key="Alt+RightArrow" action=TerminalFindNext/> <!-- Highlight next match of selected text fragment. Clipboard content is used if no active selection. -->
<key="Alt+LeftArrow" action=TerminalFindPrev/> <!-- Highlight previous match of selected text fragment. Clipboard content is used if no active selection. -->
<key="Shift+Ctrl+PageUp" action=TerminalViewportOnePageUp/> <!-- Scroll one page up. -->
<key="Shift+Ctrl+PageDown" action=TerminalViewportOnePageDown/> <!-- Scroll one page down. -->
<key="Ctrl+PageUp" mode=1 action=TerminalViewportOnePageUp/> <!-- Scroll one page up. -->
<key="Ctrl+PageDown" mode=1 action=TerminalViewportOnePageDown/> <!-- Scroll one page down. -->
<key="Shift+Alt+LeftArrow" action=TerminalViewportOnePageLeft/> <!-- Scroll one page to the left. -->
<key="Shift+Alt+RightArrow" action=TerminalViewportOnePageRight/> <!-- Scroll one page to the right. -->
<key="Shift+Ctrl+UpArrow" action=TerminalViewportOneCharUp/> <!-- Scroll one line up. -->
Expand All @@ -333,10 +345,8 @@ TerminalSelectionOneShot | |
<key="" action=TerminalSelectionCopy/> <!-- Сopy selection to clipboard. -->
<key="Esc" action=TerminalSelectionCancel/> <!-- Deselect a selection. -->
<key="" action=TerminalSelectionOneShot/> <!-- One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed. The argument can be the one of the following values 0:'none', 1:'text', 2:'ansi', 3:'rich', 4:'html', 5:'protected'. -->
<key="Ctrl-Alt" action=ToggleExclusiveKeybd/> <!-- Toggle exclusive keyboard mode by pressing and releasing Ctrl-Alt. -->
<key="Alt-Ctrl" action=ToggleExclusiveKeybd/> <!-- Toggle exclusive keyboard mode by pressing and releasing Alt-Ctrl. -->
</hotkeys>
</term>
</term>
</hotkeys>
</config>
```

Expand Down
48 changes: 27 additions & 21 deletions doc/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,14 @@ Application `app_name` | `<config/hotkeys/app_name/>` | Application layer key bi
The syntax for defining key combination bindings is:

```xml
<key="Key+Chord" action="NameOfAction"/>
<key="Key+Chord" action="NameOfAction" mode=N/> <!-- mode=0 can be omitted. -->
```

Tag | Value
---------|--------
`key` | The text string containing the key combination.
`action` | The action name.
`mode` | Hotkey mode for which mapping is being done (mode=0 by default). Either `mode=0` or `mode=1` are allowed.

The following joiners are allowed for combining keys:

Expand All @@ -334,21 +335,22 @@ The required key combination sequence can be generated on the Info page, accessi

#### Interpretation

Configuration record | Interpretation
-------------------------------------------|-----------------
`<key="Key+Chord" action=NameOfAction/>` | Append existing bindings using an indirect reference (the `NameOfAction` variable without quotes).
`<key="Key+Chord" action="NameOfAction"/>` | Append existing bindings with the directly specified command "NameOfAction".
`<key="Key+Chord" action=""/>` | Remove all existing bindings for the specified key combination "Key+Chord".
`<key="" action="NameOfAction"/>` | Do nothing.
Configuration record | Interpretation
--------------------------------------------------|-----------------
`<key="Key+Chord" action=NameOfAction/>` | Append existing bindings using an indirect reference (the `NameOfAction` variable without quotes).
`<key="Key+Chord" action="NameOfAction"/>` | Append existing bindings with the directly specified command "NameOfAction".
`<key="Key+Chord" action="NameOfAction" mode=1/>` | Append existing bindings for mode=1.
`<key="Key+Chord" action=""/>` | Remove all existing bindings for the specified key combination "Key+Chord".
`<key="" action="NameOfAction"/>` | Do nothing.

#### Available actions

Action | Default key combination | Available at layer | Description
-------------------------------|--------------------------|---------------------|------------
`Drop` | | All layers | Drop all events for the specified key combination. No further processing.
`DropIfRepeats` | | All layers | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
`DropAutoRepeat` | | All layers | Drop `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay.
`ToggleExclusiveKeybd` | `Ctrl-Alt`, `Alt-Ctrl` | Application | Toggle exclusive keyboard mode. In exclusive mode, all keyboard events are ignored by higher layers. Exclusive keyboard mode is automatically disabled when refocusing.
`ToggleHotkeyMode` | `Ctrl-Alt`, `Alt-Ctrl` | TUI matrix | Toggle hotkey mode between mode=0 (deafult) and mode=1.
`IncreaseCellHeight` | `CapsLock+UpArrow` | Native GUI window | Increase the text cell height by one pixel.
`DecreaseCellHeight` | `CapsLock+DownArrow` | Native GUI window | Decrease the text cell height by one pixel.
`ResetCellHeight` | `Ctrl+Key0` | Native GUI window | Reset text cell height.
Expand Down Expand Up @@ -791,23 +793,27 @@ Notes
</menu>
</defapp>
<hotkeys> <!-- The required key combination sequence can be generated on the Info page, accessible by clicking on the label in the lower right corner of the vtm desktop. -->
<gui key*> <!-- Native GUI window layer key bindings. -->
<gui key*> <!-- Native GUI window layer key bindings. key* here is to clear all previous bindings and start a new list. -->
<key="CapsLock+UpArrow" action=IncreaseCellHeight/> <!-- Increase the text cell height by one pixel. -->
<key="CapsLock+DownArrow" action=DecreaseCellHeight/> <!-- Decrease the text cell height by one pixel. -->
<key="Ctrl+0" action=DropIfRepeats/> <!-- Don't repeat the Reset text cell height. -->
<key="Ctrl+0" action=DropAutoRepeat/> <!-- Don't repeat the Reset text cell height. -->
<key="Ctrl+0" action=ResetCellHeight/> <!-- Reset text cell height. -->
<key="Alt+Enter" action=DropIfRepeats/> <!-- Don't repeat the Toggle fullscreen mode. -->
<key="Alt+Enter" action=DropAutoRepeat/> <!-- Don't repeat the Toggle fullscreen mode. -->
<key="Alt+Enter" action=ToggleFullscreenMode/> <!-- Toggle fullscreen mode. -->
<key="Ctrl+CapsLock" action=DropIfRepeats/> <!-- Don't repeat the Toggle text antialiasing mode. -->
<key="Ctrl+CapsLock" action=DropAutoRepeat/> <!-- Don't repeat the Toggle text antialiasing mode. -->
<key="Ctrl+CapsLock" action=ToggleAntialiasingMode/> <!-- Toggle text antialiasing mode. -->
<key="Ctrl+Shift+F11" action=DropIfRepeats/> <!-- Don't repeat the Roll font list backward. -->
<key="Ctrl+Shift+F11" action=DropAutoRepeat/> <!-- Don't repeat the Roll font list backward. -->
<key="Ctrl+Shift+F11" action=RollFontsBackward/> <!-- Roll font list backward. -->
<key="Ctrl+Shift+F12" action=DropIfRepeats/> <!-- Don't repeat the Roll font list forward. -->
<key="Ctrl+Shift+F12" action=DropAutoRepeat/> <!-- Don't repeat the Roll font list forward. -->
<key="Ctrl+Shift+F12" action=RollFontsForward/> <!-- Roll font list forward. -->
</gui>
<tui key*> <!-- TUI matrix layer key bindings. -->
<tui key*> <!-- TUI matrix layer key bindings. The mode=0 is implicitly used by default. -->
<key="Space-Backspace" action=ToggleDebugOverlay/> <!-- Toggle debug overlay. -->
<key="Backspace-Space" action=ToggleDebugOverlay/> <!-- Toggle debug overlay (Reverse release order). -->
<key="Backspace-Space" action=ToggleDebugOverlay/> <!-- Toggle debug overlay (reversed release order). -->
<key="Ctrl-Alt" action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=1 by pressing and releasing Ctrl-Alt. -->
<key="Alt-Ctrl" action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=1 by pressing and releasing Alt-Ctrl (reversed releasing). -->
<key="Ctrl-Alt" mode=1 action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=0 (default) by pressing and releasing Ctrl-Alt. -->
<key="Alt-Ctrl" mode=1 action=ToggleHotkeyMode/> <!-- Toggle hotkey mode to mode=0 (default) by pressing and releasing Alt-Ctrl (reversed releasing). -->
</tui>
<desktop key*> <!-- Desktop layer key bindings. -->
<key="Ctrl+PageUp" action=FocusPrevWindow/> <!-- Switch focus to the next desktop window. -->
Expand All @@ -821,15 +827,17 @@ Notes
<key="Alt+LeftArrow" action=TerminalFindPrev/> <!-- Highlight previous match of selected text fragment. Clipboard content is used if no active selection. -->
<key="Shift+Ctrl+PageUp" action=TerminalViewportOnePageUp/> <!-- Scroll one page up. -->
<key="Shift+Ctrl+PageDown" action=TerminalViewportOnePageDown/> <!-- Scroll one page down. -->
<key="Ctrl+PageUp" mode=1 action=TerminalViewportOnePageUp/> <!-- Scroll one page up. -->
<key="Ctrl+PageDown" mode=1 action=TerminalViewportOnePageDown/> <!-- Scroll one page down. -->
<key="Shift+Alt+LeftArrow" action=TerminalViewportOnePageLeft/> <!-- Scroll one page to the left. -->
<key="Shift+Alt+RightArrow" action=TerminalViewportOnePageRight/> <!-- Scroll one page to the right. -->
<key="Shift+Ctrl+UpArrow" action=TerminalViewportOneCharUp/> <!-- Scroll one line up. -->
<key="Shift+Ctrl+DownArrow" action=TerminalViewportOneCharDown/> <!-- Scroll one line down. -->
<key="Shift+Ctrl+LeftArrow" action=TerminalViewportOneCharLeft/> <!-- Scroll one cell to the left. -->
<key="Shift+Ctrl+RightArrow" action=TerminalViewportOneCharRight/> <!-- Scroll one cell to the right. -->
<key="Shift+Ctrl+Home" action=DropIfRepeats/> <!-- Don't repeat the Scroll to the scrollback top. -->
<key="Shift+Ctrl+Home" action=DropAutoRepeat/> <!-- Don't repeat the Scroll to the scrollback top. -->
<key="Shift+Ctrl+Home" action=TerminalViewportTop/> <!-- Scroll to the scrollback top. -->
<key="Shift+Ctrl+End" action=DropIfRepeats/> <!-- Don't repeat the Scroll to the scrollback bottom (reset viewport position). -->
<key="Shift+Ctrl+End" action=DropAutoRepeat/> <!-- Don't repeat the Scroll to the scrollback bottom (reset viewport position). -->
<key="Shift+Ctrl+End" action=TerminalViewportEnd/> <!-- Scroll to the scrollback bottom (reset viewport position). -->
<key="" action=TerminalViewportCopy/> <!-- Сopy viewport to clipboard. -->
<key="" action=TerminalClipboardPaste/> <!-- Paste from clipboard. -->
Expand All @@ -848,8 +856,6 @@ Notes
<key="" action=TerminalSelectionCopy/> <!-- Сopy selection to clipboard. -->
<key="Esc" action=TerminalSelectionCancel/> <!-- Deselect a selection. -->
<key="" action=TerminalSelectionOneShot/> <!-- One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed. -->
<key="Ctrl-Alt" action=ToggleExclusiveKeybd/> <!-- Toggle exclusive keyboard mode by pressing and releasing Ctrl-Alt. In exclusive mode, all keyboard events are ignored by higher levels. -->
<key="Alt-Ctrl" action=ToggleExclusiveKeybd/> <!-- Toggle exclusive keyboard mode by pressing and releasing Alt-Ctrl. -->
</term>
</hotkeys>
</config>
Expand Down
50 changes: 38 additions & 12 deletions doc/user-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
</thead>
<tbody>
<tr>
<th>Ctrl-Alt ²</th>
<td colspan="9">Toggle exclusive keyboard mode</td>
<th>Ctrl-Alt ¹</th>
<td colspan="9">Toggle alternate keyboard mode</td>
</tr>
<tr>
<th>F10 ²</th>
<th>F10 ¹</th>
<td colspan="9">Disconnect all users and shutdown if there are no apps running</td>
</tr>
<tr>
<th>Shift+F7 ²</th>
<th>Shift+F7 ¹</th>
<td colspan="9">Leave current session</td>
</tr>
<tr>
<th>Ctrl+PageUp/PageDown ²</th>
<th>Ctrl+PageUp/PageDown ¹</th>
<td colspan="9">Switch focus between running apps</td>
</tr>
<tr>
Expand Down Expand Up @@ -161,24 +161,24 @@
<th></th>
<th>GUI window</th>
<th>Resizing grips</th>
<th>Window 1px-height row (in fullscreen mode)¹</th>
<th>Window 1px-height row (in fullscreen mode)²</th>
</tr>
</thead>
<tbody>
<tr>
<th>Alt+Enter ²</th>
<th>Alt+Enter ¹</th>
<td colspan="3">Toggle fullscreen mode</td>
</tr>
<tr>
<th>Ctrl+CapsLock ²</th>
<th>Ctrl+CapsLock ¹</th>
<td colspan="3">Toggle antialiasing mode</td>
</tr>
<tr>
<th>CapsLock+UpArrow/DownArrow ²</th>
<th>CapsLock+UpArrow/DownArrow ¹</th>
<td colspan="3">Scale cell size</td>
</tr>
<tr>
<th>CapsLock+0 ²</th>
<th>CapsLock+0 ¹</th>
<td colspan="3">Reset cell size</td>
</tr>
<tr>
Expand Down Expand Up @@ -214,5 +214,31 @@
</tbody>
</table>

¹ — In fullscreen mode, the GUI window reserves a 1px high area at the top for forwarding mouse events.
² — Key bindings can be customized using the settings.
## Built-in Terminal

<table>
<thead>
<tr><th>Hotkey ¹</th> <th>Default action</th></tr>
</thead>
<tbody>
<tr><th>Alt+RightArrow</th> <td>Highlight next match of selected text fragment. Clipboard content is used if no active selection.</td></tr>
<tr><th>Alt+LeftArrow</th> <td>Highlight previous match of selected text fragment. Clipboard content is used if no active selection.</td></tr>
<tr><th>Shift+Ctrl+PageUp</th> <td>Scroll one page up.</td></tr>
<tr><th>Shift+Ctrl+PageDown</th> <td>Scroll one page down.</td></tr>
<tr><th>Shift+Alt+LeftArrow</th> <td>Scroll one page to the left.</td></tr>
<tr><th>Shift+Alt+RightArrow</th> <td>Scroll one page to the right.</td></tr>
<tr><th>Shift+Ctrl+UpArrow</th> <td>Scroll one line up.</td></tr>
<tr><th>Shift+Ctrl+DownArrow</th> <td>Scroll one line down.</td></tr>
<tr><th>Shift+Ctrl+LeftArrow</th> <td>Scroll one cell to the left.</td></tr>
<tr><th>Shift+Ctrl+RightArrow</th> <td>Scroll one cell to the right.</td></tr>
<tr><th>Shift+Ctrl+Home</th> <td>Don't repeat the Scroll to the scrollback top.</td></tr>
<tr><th>Shift+Ctrl+Home</th> <td>Scroll to the scrollback top.</td></tr>
<tr><th>Shift+Ctrl+End</th> <td>Don't repeat the Scroll to the scrollback bottom (reset viewport position).</td></tr>
<tr><th>Shift+Ctrl+End</th> <td>Scroll to the scrollback bottom (reset viewport position).</td></tr>
</tbody>
</table>

---

¹ — Key bindings can be customized using settings.
² — In fullscreen mode, the GUI window reserves a 1px high area at the top for forwarding mouse events.
Loading

0 comments on commit 238bdd0

Please sign in to comment.