directvt / vtm

Text-based desktop environment
MIT License
1.63k stars 43 forks source link

Allow hotkey scheme to be an arbitrary string #686

Closed o-sdn-o closed 4 days ago

o-sdn-o commented 4 days ago

Changes

<config>
    <term>
        <menu>
            <item type="Option" action=SwitchHotkeyScheme label=" Keys0 " data="">
                <label="\e[48:2:0:128:128;38:2:0:255:0m Keys1 \e[m" data="1"/>
                <tooltip>
                    " Toggle hotkey scheme                          \n"
                    "   Alternative hotkey scheme allows keystrokes \n"
                    "   to be passed through without processing     "
                </tooltip>
            </item>
        </menu>
    </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 scheme=0 is implicitly used by default. -->
            <key="Space-Backspace | Backspace-Space" action=ToggleDebugOverlay/>  <!-- Toggle debug overlay. -->
            <key="Ctrl-Alt | Alt-Ctrl" scheme=""> <action=SwitchHotkeyScheme data="1"/></key>  <!-- Switch the hotkey scheme to "1" by pressing and releasing Ctrl-Alt or Alt-Ctrl (reversed release order). -->
            <key="Ctrl-Alt | Alt-Ctrl" scheme="1"><action=SwitchHotkeyScheme data=""/> </key>  <!-- Switch the hotkey scheme to default by pressing and releasing Ctrl-Alt or Alt-Ctrl (reversed release order). -->
        </tui>
        <term key*>  <!-- Application specific layer key bindings. -->
            <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=TerminalScrollViewportByPage data=" 0, 1"/></key>  <!-- Scroll viewport one page up. -->
            <key="Shift+Ctrl+PageDown">     <action=TerminalScrollViewportByPage data=" 0,-1"/></key>  <!-- Scroll viewport one page down. -->
            <key="Ctrl+PageUp"   scheme="1"><action=TerminalScrollViewportByPage data=" 0, 1"/></key>  <!-- Scroll viewport one page up. -->
            <key="Ctrl+PageDown" scheme="1"><action=TerminalScrollViewportByPage data=" 0,-1"/></key>  <!-- Scroll viewport one page down. -->
            <key="Shift+Alt+LeftArrow">     <action=TerminalScrollViewportByPage data=" 1, 0"/></key>  <!-- Scroll viewport one page to the left. -->
            <key="Shift+Alt+RightArrow">    <action=TerminalScrollViewportByPage data="-1, 0"/></key>  <!-- Scroll viewport one page to the right. -->
            <key="Shift+Ctrl+UpArrow">      <action=TerminalScrollViewportByCell data=" 0, 1"/></key>  <!-- Scroll viewport one line up. -->
            <key="Shift+Ctrl+DownArrow">    <action=TerminalScrollViewportByCell data=" 0,-1"/></key>  <!-- Scroll viewport one line down. -->
            <key="Shift+Ctrl+LeftArrow">    <action=TerminalScrollViewportByCell data=" 1, 0"/></key>  <!-- Scroll viewport one cell to the left. -->
            <key="Shift+Ctrl+RightArrow">   <action=TerminalScrollViewportByCell data="-1, 0"/></key>  <!-- Scroll viewport one cell to the right. -->
        </term>
    </hotkeys>
</config>