단축키 변경: S -> Cmd + S, O -> Cmd + O
This commit is contained in:
@@ -112,8 +112,8 @@ Prefer narrow utility modules (`utils/file-names.js`, `utils/dom.js`) over broad
|
|||||||
- `sortMode` — `'name'` | `'date'` | `null`
|
- `sortMode` — `'name'` | `'date'` | `null`
|
||||||
|
|
||||||
**Keyboard shortcuts** (모두 `e.code` 기준 — 한글 입력 모드에서도 동작):
|
**Keyboard shortcuts** (모두 `e.code` 기준 — 한글 입력 모드에서도 동작):
|
||||||
- `O` — 폴더 열기
|
- `Cmd+O` — 폴더 열기
|
||||||
- `S` — 이름 변경 실행
|
- `Cmd+S` — 이름 변경 실행
|
||||||
- `A` — 전체 선택
|
- `A` — 전체 선택
|
||||||
- `Cmd+Z` — Undo (되돌리기)
|
- `Cmd+Z` — Undo (되돌리기)
|
||||||
- `Cmd+Shift+Z` — Redo (다시하기)
|
- `Cmd+Shift+Z` — Redo (다시하기)
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
<nav class="sidebar-nav">
|
<nav class="sidebar-nav">
|
||||||
<button class="btn btn-warning" id="btn-open">폴더 열기 (O)</button>
|
<button class="btn btn-warning" id="btn-open">폴더 열기 (⌘O)</button>
|
||||||
<button class="btn btn-success" id="btn-rename" disabled>이름 변경 실행 (S)</button>
|
<button class="btn btn-success" id="btn-rename" disabled>이름 변경 실행 (⌘S)</button>
|
||||||
</nav>
|
</nav>
|
||||||
<section class="file-explorer">
|
<section class="file-explorer">
|
||||||
<!-- 추후 구현 -->
|
<!-- 추후 구현 -->
|
||||||
|
|||||||
@@ -10,12 +10,15 @@ export function initKeyboardShortcuts({
|
|||||||
}) {
|
}) {
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
if (hasOpenModal()) return;
|
if (hasOpenModal()) return;
|
||||||
if (isEditableTarget(e.target)) return;
|
const isMetaOpenOrSave = e.metaKey && (e.code === 'KeyO' || e.code === 'KeyS');
|
||||||
|
if (isEditableTarget(e.target) && !isMetaOpenOrSave) return;
|
||||||
|
|
||||||
if (e.code === 'KeyO') {
|
if (e.metaKey && e.code === 'KeyO') {
|
||||||
|
e.preventDefault();
|
||||||
btnOpen.click();
|
btnOpen.click();
|
||||||
} else if (e.code === 'KeyS' && !btnRename.disabled) {
|
} else if (e.metaKey && e.code === 'KeyS') {
|
||||||
btnRename.click();
|
e.preventDefault();
|
||||||
|
if (!btnRename.disabled) btnRename.click();
|
||||||
} else if (e.code === 'KeyA') {
|
} else if (e.code === 'KeyA') {
|
||||||
selectAll();
|
selectAll();
|
||||||
refreshSelection();
|
refreshSelection();
|
||||||
|
|||||||
Reference in New Issue
Block a user