Quick Example
useEscapeKeydown Usage
ตัวอย่าง import และการใช้งานแบบสั้นสำหรับหน้า `use-escape-keydown`
Code
<script lang="ts">
import { useEscapeKeydown } from 'svelora';
useEscapeKeydown(() => {
console.log('escape pressed');
});
</script>
useEscapeKeydown
Svelte action that listens for the Escape key. Lightweight alternative to useKbd when you only need Escape.
Basic
Press Escape anywhere on this page.
Escape pressed: 0 times
Dismiss Panel
Confirmation Dialog
Press Escape to cancel the confirmation.