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