p5.js-web-editor/client/modules/IDE/components/KeyboardShortcutModal.jsx

93 lines
3.6 KiB
React
Raw Normal View History

import React from 'react';
import { useTranslation } from 'react-i18next';
import { metaKeyName, } from '../../../utils/metaKey';
function KeyboardShortcutModal() {
const { t } = useTranslation();
return (
2020-05-26 21:48:47 +00:00
<div className="keyboard-shortcuts">
<h3 className="keyboard-shortcuts__title">{t('KeyboardShortcuts.CodeEditing.CodeEditing')}</h3>
<p className="keyboard-shortcuts__description">
{t('KeyboardShortcuts.ShortcutsFollow')} <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">{t('KeyboardShortcuts.SublimeText')}</a>.
</p>
<ul className="keyboard-shortcuts__list">
2020-05-26 21:48:47 +00:00
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">{'\u21E7'} + Tab</span>
<span>{t('KeyboardShortcuts.CodeEditing.Tidy')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + F
</span>
<span>{t('KeyboardShortcuts.CodeEditing.FindText')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + G
</span>
<span>{t('KeyboardShortcuts.CodeEditing.FindNextTextMatch')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + {'\u21E7'} + G
</span>
<span>{t('KeyboardShortcuts.CodeEditing.FindPreviousTextMatch')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + [
</span>
<span>{t('KeyboardShortcuts.CodeEditing.IndentCodeLeft')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + ]
</span>
<span>{t('KeyboardShortcuts.CodeEditing.IndentCodeRight')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + /
</span>
<span>{t('KeyboardShortcuts.CodeEditing.CommentLine')}</span>
2020-05-26 21:48:47 +00:00
</li>
</ul>
<h3 className="keyboard-shortcuts__title">General</h3>
<ul className="keyboard-shortcuts__list">
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + S
</span>
<span>{t('Common.Save')}</span>
</li>
2020-05-26 21:48:47 +00:00
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + Enter
</span>
<span>{t('KeyboardShortcuts.General.StartSketch')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + {'\u21E7'} + Enter
</span>
<span>{t('KeyboardShortcuts.General.StopSketch')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + {'\u21E7'} + 1
</span>
<span>{t('KeyboardShortcuts.General.TurnOnAccessibleOutput')}</span>
2020-05-26 21:48:47 +00:00
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{metaKeyName} + {'\u21E7'} + 2
</span>
<span>{t('KeyboardShortcuts.General.TurnOffAccessibleOutput')}</span>
2020-05-26 21:48:47 +00:00
</li>
</ul>
</div>
);
2016-09-07 21:47:22 +00:00
}
export default KeyboardShortcutModal;