mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-03 08:32:52 +00:00
feat: change icons
This commit is contained in:
@@ -151,4 +151,3 @@ actions:
|
|||||||
127:
|
127:
|
||||||
id: "DEL"
|
id: "DEL"
|
||||||
title: Delete
|
title: Delete
|
||||||
icon: delete_forever
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ actions:
|
|||||||
536:
|
536:
|
||||||
id: "DUP"
|
id: "DUP"
|
||||||
title: Repeat Last Note
|
title: Repeat Last Note
|
||||||
icon: control_point_duplicate
|
icon: copy_all
|
||||||
description: |
|
description: |
|
||||||
In character entry, it repeats your last input.
|
In character entry, it repeats your last input.
|
||||||
In chorded entry, it is used for words with repeating letters.
|
In chorded entry, it is used for words with repeating letters.
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ icon: keyboard
|
|||||||
actions:
|
actions:
|
||||||
512: &left_ctrl
|
512: &left_ctrl
|
||||||
id: "LEFT_CTRL"
|
id: "LEFT_CTRL"
|
||||||
|
display: CTRL
|
||||||
title: Control Keyboard Modifier
|
title: Control Keyboard Modifier
|
||||||
variant: left
|
variant: left
|
||||||
icon: keyboard_control_key
|
|
||||||
513: &left_shift
|
513: &left_shift
|
||||||
id: "LEFT_SHIFT"
|
id: "LEFT_SHIFT"
|
||||||
title: Shift Keyboard Modifier
|
title: Shift Keyboard Modifier
|
||||||
@@ -14,14 +14,14 @@ actions:
|
|||||||
icon: shift
|
icon: shift
|
||||||
514: &left_alt
|
514: &left_alt
|
||||||
id: "LEFT_ALT"
|
id: "LEFT_ALT"
|
||||||
|
display: ALT
|
||||||
title: Alt Keyboard Modifier
|
title: Alt Keyboard Modifier
|
||||||
variant: left
|
variant: left
|
||||||
icon: keyboard_option_key
|
|
||||||
515: &left_gui
|
515: &left_gui
|
||||||
id: "LEFT_GUI"
|
id: "LEFT_GUI"
|
||||||
title: GUI Keyboard Modifier
|
title: GUI Keyboard Modifier
|
||||||
|
icon: apps
|
||||||
variant: left
|
variant: left
|
||||||
icon: keyboard_command_key
|
|
||||||
516:
|
516:
|
||||||
variationOf: 512
|
variationOf: 512
|
||||||
<<: *left_ctrl
|
<<: *left_ctrl
|
||||||
|
|||||||
1
src/lib/assets/keymaps/keymap.d.ts
vendored
1
src/lib/assets/keymaps/keymap.d.ts
vendored
@@ -2,6 +2,7 @@ export interface KeymapCategory {
|
|||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
icon?: string
|
icon?: string
|
||||||
|
display?: string
|
||||||
type?: "unassigned"
|
type?: "unassigned"
|
||||||
actions: Record<number, Partial<ActionInfo>>
|
actions: Record<number, Partial<ActionInfo>>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
class:right={info.variant === "right"}
|
class:right={info.variant === "right"}
|
||||||
use:title={{title: tooltip}}
|
use:title={{title: tooltip}}
|
||||||
>
|
>
|
||||||
{info.icon ?? info.id ?? `0x${info.code.toString(16)}`}
|
{info.icon ?? info.display ?? info.id ?? `0x${info.code.toString(16)}`}
|
||||||
</kbd>
|
</kbd>
|
||||||
{:else if display === "inline-keys"}
|
{:else if display === "inline-keys"}
|
||||||
{#if !info.icon && info.id?.length === 1}
|
{#if !info.icon && info.id?.length === 1}
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
class:icon={!!info.icon}
|
class:icon={!!info.icon}
|
||||||
use:title={{title: tooltip}}
|
use:title={{title: tooltip}}
|
||||||
>
|
>
|
||||||
{info.icon ?? info.id ?? `0x${info.code.toString(16)}`}</kbd
|
{info.icon ?? info.display ?? info.id ?? `0x${info.code.toString(16)}`}</kbd
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
{#each positions as position, layer}
|
{#each positions as position, layer}
|
||||||
{@const {action: actionId, isApplied} = $layout[layer][key.id] ?? {action: 0, isApplied: true}}
|
{@const {action: actionId, isApplied} = $layout[layer][key.id] ?? {action: 0, isApplied: true}}
|
||||||
{@const {code, icon, id, title, keyCode, variant} = KEYMAP_CODES[actionId] ?? {code: actionId}}
|
{@const {code, icon, id, display, title, keyCode, variant} = KEYMAP_CODES[actionId] ?? {code: actionId}}
|
||||||
{@const dynamicMapping = keyCode && $osLayout[JSON.stringify([keyCode])]}
|
{@const dynamicMapping = keyCode && $osLayout[JSON.stringify([keyCode])]}
|
||||||
{@const tooltip =
|
{@const tooltip =
|
||||||
(title ?? id ?? `0x${code.toString(16)}`) +
|
(title ?? id ?? `0x${code.toString(16)}`) +
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
use:action={{title: tooltip}}
|
use:action={{title: tooltip}}
|
||||||
>
|
>
|
||||||
{#if code !== 0}
|
{#if code !== 0}
|
||||||
{dynamicMapping || icon || id || `0x${code.toString(16)}`}
|
{dynamicMapping || icon || display || id || `0x${code.toString(16)}`}
|
||||||
{/if}
|
{/if}
|
||||||
{#if !isApplied}
|
{#if !isApplied}
|
||||||
<tspan>•</tspan>
|
<tspan>•</tspan>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export function runLayoutDetection() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
window.addEventListener("keydown", keydown)
|
// TODO: do we want this?
|
||||||
window.addEventListener("keyup", keyup)
|
//window.addEventListener("keydown", keydown)
|
||||||
|
//window.addEventListener("keyup", keyup)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user