<script>
import {shortcut} from './shortcut.js'
let buttonCount = 0, divCount = 0;
</script>
<table>
<tr>
<td>
<button use:shortcut={{shift: true, code: 'Digit1'}} on:click={() => buttonCount++}>
Triggers a click on the button (Shift + 1)
</button>
</td>
<td>
Clicked: {buttonCount}
</td>
</tr>
<tr>
<td use:shortcut={{control: true, alt: true, code: 'Digit2', callback: () => divCount++}}>
Will trigger a callback (Cmd/Ctrl + Alt + 2)
</td>
<td>
Clicked: {divCount}
</td>
</tr>
</table>