Merge pull request #1438 from tirtawr/add-keyboard-shortcut-note
Add keyboard shortcut note
This commit is contained in:
commit
b2877f4b3a
3 changed files with 112 additions and 86 deletions
|
@ -3,90 +3,87 @@ import { metaKeyName, } from '../../../utils/metaKey';
|
||||||
|
|
||||||
function KeyboardShortcutModal() {
|
function KeyboardShortcutModal() {
|
||||||
return (
|
return (
|
||||||
<ul className="keyboard-shortcuts" title="keyboard shortcuts">
|
<div className="keyboard-shortcuts">
|
||||||
<li className="keyboard-shortcut-item">
|
<h3 className="keyboard-shortcuts__title">Code Editing</h3>
|
||||||
<span className="keyboard-shortcut__command">{'\u21E7'} + Tab</span>
|
<p className="keyboard-shortcuts__description">
|
||||||
<span>Tidy</span>
|
Code editing keyboard shortcuts follow <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">Sublime Text shortcuts</a>.
|
||||||
</li>
|
</p>
|
||||||
<li className="keyboard-shortcut-item">
|
<ul className="keyboard-shortcuts__list">
|
||||||
<span className="keyboard-shortcut__command">
|
<li className="keyboard-shortcut-item">
|
||||||
{metaKeyName} + S
|
<span className="keyboard-shortcut__command">{'\u21E7'} + Tab</span>
|
||||||
</span>
|
<span>Tidy</span>
|
||||||
<span>Save</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + F
|
||||||
{metaKeyName} + F
|
</span>
|
||||||
</span>
|
<span>Find Text</span>
|
||||||
<span>Find Text</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + G
|
||||||
{metaKeyName} + G
|
</span>
|
||||||
</span>
|
<span>Find Next Text Match</span>
|
||||||
<span>Find Next Text Match</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + {'\u21E7'} + G
|
||||||
{metaKeyName} + {'\u21E7'} + G
|
</span>
|
||||||
</span>
|
<span>Find Previous Text Match</span>
|
||||||
<span>Find Previous Text Match</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + [
|
||||||
{metaKeyName} + [
|
</span>
|
||||||
</span>
|
<span>Indent Code Left</span>
|
||||||
<span>Indent Code Left</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + ]
|
||||||
{metaKeyName} + ]
|
</span>
|
||||||
</span>
|
<span>Indent Code Right</span>
|
||||||
<span>Indent Code Right</span>
|
</li>
|
||||||
</li>
|
<li className="keyboard-shortcut-item">
|
||||||
<li className="keyboard-shortcut-item">
|
<span className="keyboard-shortcut__command">
|
||||||
<span className="keyboard-shortcut__command">
|
{metaKeyName} + /
|
||||||
{metaKeyName} + /
|
</span>
|
||||||
</span>
|
<span>Comment Line</span>
|
||||||
<span>Comment Line</span>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
<li className="keyboard-shortcut-item">
|
<h3 className="keyboard-shortcuts__title">General</h3>
|
||||||
<span className="keyboard-shortcut__command">
|
<ul className="keyboard-shortcuts__list">
|
||||||
{metaKeyName} + Enter
|
<li className="keyboard-shortcut-item">
|
||||||
</span>
|
<span className="keyboard-shortcut__command">
|
||||||
<span>Start Sketch</span>
|
{metaKeyName} + S
|
||||||
</li>
|
</span>
|
||||||
<li className="keyboard-shortcut-item">
|
<span>Save</span>
|
||||||
<span className="keyboard-shortcut__command">
|
</li>
|
||||||
{metaKeyName} + {'\u21E7'} + Enter
|
<li className="keyboard-shortcut-item">
|
||||||
</span>
|
<span className="keyboard-shortcut__command">
|
||||||
<span>Stop Sketch</span>
|
{metaKeyName} + Enter
|
||||||
</li>
|
</span>
|
||||||
<li className="keyboard-shortcut-item">
|
<span>Start Sketch</span>
|
||||||
<span className="keyboard-shortcut__command">
|
</li>
|
||||||
{metaKeyName} + {'\u21E7'} + 1
|
<li className="keyboard-shortcut-item">
|
||||||
</span>
|
<span className="keyboard-shortcut__command">
|
||||||
<span>Turn on Accessible Output</span>
|
{metaKeyName} + {'\u21E7'} + Enter
|
||||||
</li>
|
</span>
|
||||||
<li className="keyboard-shortcut-item">
|
<span>Stop Sketch</span>
|
||||||
<span className="keyboard-shortcut__command">
|
</li>
|
||||||
{metaKeyName} + {'\u21E7'} + 2
|
<li className="keyboard-shortcut-item">
|
||||||
</span>
|
<span className="keyboard-shortcut__command">
|
||||||
<span>Turn off Accessible Output</span>
|
{metaKeyName} + {'\u21E7'} + 1
|
||||||
</li>
|
</span>
|
||||||
<li className="keyboard-shortcut-item">
|
<span>Turn on Accessible Output</span>
|
||||||
<span className="keyboard-shortcut__command">
|
</li>
|
||||||
{metaKeyName} + B
|
<li className="keyboard-shortcut-item">
|
||||||
</span>
|
<span className="keyboard-shortcut__command">
|
||||||
<span>Toggle Sidebar</span>
|
{metaKeyName} + {'\u21E7'} + 2
|
||||||
</li>
|
</span>
|
||||||
<li className="keyboard-shortcut-item">
|
<span>Turn off Accessible Output</span>
|
||||||
<span className="keyboard-shortcut__command">
|
</li>
|
||||||
Ctrl + `
|
</ul>
|
||||||
</span>
|
</div>
|
||||||
<span>Toggle Console</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ h2 {
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
font-size: #{16 / $base-font-size}rem;
|
||||||
}
|
}
|
||||||
h4 {
|
h4 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
|
@ -4,6 +4,11 @@
|
||||||
width: #{450 / $base-font-size}rem;
|
width: #{450 / $base-font-size}rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.keyboard-shortcuts-note {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.keyboard-shortcut-item {
|
.keyboard-shortcut-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
& + & {
|
& + & {
|
||||||
|
@ -13,8 +18,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.keyboard-shortcut__command {
|
.keyboard-shortcut__command {
|
||||||
width: 50%;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: #{10 / $base-font-size}rem;
|
margin-right: #{10 / $base-font-size}rem;
|
||||||
|
padding: #{3 / $base-font-size}rem;
|
||||||
|
@include themify {
|
||||||
|
border: 1px solid getThemifyVariable("button-border-color");
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard-shortcuts__title {
|
||||||
|
padding-bottom: #{10 / $base-font-size}rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard-shortcuts__description {
|
||||||
|
padding-bottom: #{10 / $base-font-size}rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard-shortcuts__list:not(:last-of-type) {
|
||||||
|
padding-bottom: #{10 / $base-font-size}rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard-shortcuts__title:not(:first-of-type) {
|
||||||
|
@include themify() {
|
||||||
|
border-top: 1px dashed getThemifyVariable("button-border-color");
|
||||||
|
padding-top: #{10 / $base-font-size}rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue