feat: keyboard类 & todo

This commit is contained in:
AncTe committed 2024-01-18 15:25:33 +08:00
1 parent 60d708e5e3
commit e77ca3e376
14 files changed
+262 -45

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
<template>
<div class="keyboard-container"></div>
</template>
<script lang="ts" setup>
import { Keyboard } from '@/core/main/custom/keyboard';
import { KeyboardEmits } from '@/core/main/custom/keyboard';
import { ref } from 'vue';
const props = defineProps<{
keyboard: Keyboard;
}>();
const [width, height] = (() => {
const key = props.keyboard;
const mw = Math.max(...key.keys.map(v => v.x));
const mh = Math.max(...key.keys.map(v => v.y));
return [mw, mh];
})();
const emits = defineEmits<{
(e: 'keyup', data: KeyboardEmits): void;
}>();
</script>
<style lang="less" scoped>
.keyboard-container {
width: v-bind(width);
height: v-bind(height);
}
</style>