mirror of
https://github.com/pheralb/svgl.git
synced 2025-03-20 04:01:17 +08:00
feat: add input hotkey script
This commit is contained in:
parent
f610a94ef2
commit
dc2aaf2f73
@ -5,12 +5,14 @@
|
|||||||
export let clearSearch: () => void;
|
export let clearSearch: () => void;
|
||||||
import X from 'phosphor-svelte/lib/X';
|
import X from 'phosphor-svelte/lib/X';
|
||||||
|
|
||||||
let shortcutText = 'control';
|
let shortcutText: string = '';
|
||||||
let inputElement;
|
let inputElement;
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
if (navigator.platform.toUpperCase().indexOf('MAC') !== -1) {
|
if (navigator.platform.toUpperCase().indexOf('MAC') !== -1) {
|
||||||
shortcutText = 'command';
|
shortcutText = 'command';
|
||||||
|
} else {
|
||||||
|
shortcutText = 'control';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,10 +66,11 @@
|
|||||||
<div class="flex h-full items-center pointer-events-none gap-x-1">
|
<div class="flex h-full items-center pointer-events-none gap-x-1">
|
||||||
{#if shortcutText === 'command'}
|
{#if shortcutText === 'command'}
|
||||||
<Command size={20} />
|
<Command size={20} />
|
||||||
{:else}
|
<span>K</span>
|
||||||
|
{:else if shortcutText === 'control'}
|
||||||
<span>Ctrl</span>
|
<span>Ctrl</span>
|
||||||
|
<span>K</span>
|
||||||
{/if}
|
{/if}
|
||||||
<span>K</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user