fix: enhance shortcut key detection for alt key combinations and update Discord invite link across all pages.
This commit is contained in:
@@ -155,7 +155,16 @@ export class ShortcutsManager {
|
||||
if (e.altKey) keys.push('alt');
|
||||
if (e.shiftKey) keys.push('shift');
|
||||
|
||||
const key = e.key.toLowerCase();
|
||||
let key = e.key.toLowerCase();
|
||||
|
||||
if (e.altKey && e.code) {
|
||||
if (e.code.startsWith('Key')) {
|
||||
key = e.code.slice(3).toLowerCase();
|
||||
} else if (e.code.startsWith('Digit')) {
|
||||
key = e.code.slice(5);
|
||||
}
|
||||
}
|
||||
|
||||
if (!['control', 'shift', 'alt', 'meta'].includes(key)) {
|
||||
keys.push(key);
|
||||
}
|
||||
@@ -184,6 +193,6 @@ export class ShortcutsManager {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, { capture: true });
|
||||
}, { capture: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ const init = () => {
|
||||
}
|
||||
|
||||
if (window.location.hash.startsWith('#tool-')) {
|
||||
const toolId = window.location.hash.substring(6);
|
||||
const toolId = window.location.hash.substring(6);
|
||||
setTimeout(() => {
|
||||
setupToolInterface(toolId);
|
||||
history.replaceState(null, '', window.location.pathname);
|
||||
@@ -560,7 +560,7 @@ const init = () => {
|
||||
input.className = 'shortcut-input w-32 bg-gray-800 border border-gray-600 text-white text-center text-sm rounded px-2 py-1 focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none transition-all';
|
||||
input.placeholder = 'Click to set';
|
||||
input.value = formatShortcutDisplay(currentShortcut, isMac);
|
||||
input.readOnly = true;
|
||||
input.readOnly = true;
|
||||
|
||||
const clearBtn = document.createElement('button');
|
||||
clearBtn.className = 'absolute -right-2 -top-2 bg-gray-700 hover:bg-red-600 text-white rounded-full p-0.5 hidden group-hover:block shadow-sm';
|
||||
@@ -572,7 +572,7 @@ const init = () => {
|
||||
clearBtn.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
ShortcutsManager.setShortcut(toolId, '');
|
||||
renderShortcutsList();
|
||||
renderShortcutsList();
|
||||
};
|
||||
|
||||
input.onkeydown = async (e) => {
|
||||
@@ -597,7 +597,16 @@ const init = () => {
|
||||
if (e.altKey) keys.push('alt');
|
||||
if (e.shiftKey) keys.push('shift');
|
||||
|
||||
const key = e.key.toLowerCase();
|
||||
let key = e.key.toLowerCase();
|
||||
|
||||
if (e.altKey && e.code) {
|
||||
if (e.code.startsWith('Key')) {
|
||||
key = e.code.slice(3).toLowerCase();
|
||||
} else if (e.code.startsWith('Digit')) {
|
||||
key = e.code.slice(5);
|
||||
}
|
||||
}
|
||||
|
||||
const isModifier = ['control', 'shift', 'alt', 'meta'].includes(key);
|
||||
const isDeadKey = key === 'dead' || key.startsWith('dead');
|
||||
|
||||
@@ -628,7 +637,7 @@ const init = () => {
|
||||
`<strong>${displayCombo}</strong> is already assigned to:<br><br>` +
|
||||
`<em>"${existingToolName}"</em><br><br>` +
|
||||
`Please choose a different shortcut.`,
|
||||
false
|
||||
false
|
||||
);
|
||||
|
||||
input.value = formatShortcutDisplay(ShortcutsManager.getShortcut(toolId) || '', isMac);
|
||||
|
||||
@@ -93,13 +93,12 @@
|
||||
<h2 class="text-lg font-semibold text-white">Stamp Editor</h2>
|
||||
<p class="text-xs text-gray-400">Use the toolbar's image stamp tool to place stamps.</p>
|
||||
</div>
|
||||
<div id="stamp-viewer-container" class="h-[70vh] bg-black/70 flex items-stretch justify-stretch">
|
||||
<div id="stamp-viewer-container" class="h-[70vh] bg-black/70 flex items-stretch justify-stretch">
|
||||
<!-- iframe injected by add-stamps.ts -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="save-stamped-btn"
|
||||
class="btn-gradient w-full mt-6 flex items-center justify-center gap-2">
|
||||
<button id="save-stamped-btn" class="btn-gradient w-full mt-6 flex items-center justify-center gap-2">
|
||||
<span>Save Stamped PDF</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -159,7 +158,7 @@
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://discord.gg/q42xWQmJ" target="_blank" rel="noopener noreferrer"
|
||||
<a href="https://discord.gg/AP2Y97juZT" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-indigo-400" title="Discord">
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
@@ -191,4 +190,4 @@
|
||||
<script type="module" src="../js/mobileMenu.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -462,7 +462,7 @@
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://discord.gg/q42xWQmJ" target="_blank" rel="noopener noreferrer"
|
||||
<a href="https://discord.gg/AP2Y97juZT" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-indigo-400" title="Discord">
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
@@ -494,4 +494,4 @@
|
||||
<script type="module" src="../js/mobileMenu.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -158,7 +158,7 @@
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://discord.gg/q42xWQmJ" target="_blank" rel="noopener noreferrer"
|
||||
<a href="https://discord.gg/AP2Y97juZT" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-indigo-400" title="Discord">
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
@@ -190,4 +190,4 @@
|
||||
<script type="module" src="../js/mobileMenu.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -152,7 +152,7 @@
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://discord.gg/q42xWQmJ" target="_blank" rel="noopener noreferrer"
|
||||
<a href="https://discord.gg/AP2Y97juZT" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-indigo-400" title="Discord">
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
@@ -184,4 +184,4 @@
|
||||
<script type="module" src="../js/mobileMenu.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -221,7 +221,7 @@
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://discord.gg/q42xWQmJ" target="_blank" rel="noopener noreferrer"
|
||||
<a href="https://discord.gg/AP2Y97juZT" target="_blank" rel="noopener noreferrer"
|
||||
class="text-gray-400 hover:text-indigo-400" title="Discord">
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
|
||||
Reference in New Issue
Block a user