Skip to content

Commit

Permalink
fix double binding of shortcut "d" (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetti22 authored May 26, 2024
1 parent a4dc7f7 commit 6eafa75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/editor/MainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class MainMenu {
template.innerHTML = `
<se-menu id="main_button" label="SVG-Edit" src="logo.svg" alt="logo">
<se-menu-item id="tool_export" label="tools.export_img" src="export.svg"></se-menu-item>
<se-menu-item id="tool_docprops" label="tools.docprops" shortcut="D" src="docprop.svg"></se-menu-item>
<se-menu-item id="tool_docprops" label="tools.docprops" shortcut="shift+D" src="docprop.svg"></se-menu-item>
<se-menu-item id="tool_editor_prefs" label="config.editor_prefs" src="editPref.svg"></se-menu-item>
<se-menu-item id="tool_editor_homepage" label="tools.editor_homepage" src="logo.svg"></se-menu-item>
</se-menu>`
Expand Down
2 changes: 1 addition & 1 deletion src/editor/components/seMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class SeMenuItem extends HTMLElement {
// only track keyboard shortcuts for the body containing the SVG-Editor
if (e.target.nodeName !== 'BODY') return
// normalize key
const key = `${(e.metaKey) ? 'meta+' : ''}${(e.ctrlKey) ? 'ctrl+' : ''}${e.key.toUpperCase()}`
const key = `${(e.metaKey) ? 'meta+' : ''}${(e.ctrlKey) ? 'ctrl+' : ''}${(e.shiftKey) ? 'shift+' : ''}${e.key.toUpperCase()}`
if (shortcut !== key) return
// launch the click event
if (this.id) {
Expand Down

0 comments on commit 6eafa75

Please sign in to comment.