feat: show warnings about shift and alt-code macros

resolves #38
This commit is contained in:
2023-12-02 23:26:04 +01:00
parent dc798d2b9f
commit d9dd003b01
5 changed files with 163 additions and 141 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts">
import {KEYMAP_CODES} from "$lib/serial/keymap-codes"
import type {KeyInfo} from "$lib/serial/keymap-codes"
import LL from "../../i18n/i18n-svelte"
export let id: number | KeyInfo
@@ -21,6 +22,12 @@
{#if key.description}
<i>{key.description}</i>
{/if}
{#if key.category.name === "ASCII Macros"}
<span class="warning">{@html $LL.actionSearch.SHIFT_WARNING()}</span>
{/if}
{#if key.category.name === "CP-1252"}
<span class="warning">{@html $LL.actionSearch.ALT_CODE_WARNING()}</span>
{/if}
</div>
<kbd class:icon={!!key.icon}>{key.icon || key.id || `0x${key.code.toString(16)}`}</kbd>
{:else}
@@ -63,6 +70,17 @@
text-align: start;
}
.warning {
display: flex;
align-items: center;
gap: 4px;
color: var(--md-sys-color-error);
> :global(.icon) {
font-size: 16px;
}
}
kbd {
height: 24px;
}