monome grid-like output from a qwerty keyboard
import Qwerty32 from 'qwerty32'
const device = await Qwerty32.connect()
device.addEventListener('gridKeyDown', (event) => {
console.log(event.detail.x, event.detail.y, 1)
})
device.addEventListener('gridKeyUp', (event) => {
console.log(event.detail.x, event.detail.y, 0)
})
device.addEventListener('query', (event) => {
console.log(event.detail) // { type: 2, count: 1 }
})
device.addEventListener('getId', (event) => {
console.log(event.detail) // qwerty 32
})
device.addEventListener('getGridSize', (event) => {
console.log(event.detail) // { x: 8, y: 4 }
})
device.query()
device.getId()
device.getGridSize()
- 1:
{ x: 0, y: 0 }
- 2:
{ x: 1, y: 0 }
- 3:
{ x: 2, y: 0 }
- 4:
{ x: 3, y: 0 }
- 5:
{ x: 4, y: 0 }
- 6:
{ x: 5, y: 0 }
- 7:
{ x: 6, y: 0 }
- 8:
{ x: 7, y: 0 }
- q:
{ x: 0, y: 1 }
- w:
{ x: 1, y: 1 }
- e:
{ x: 2, y: 1 }
- r:
{ x: 3, y: 1 }
- t:
{ x: 4, y: 1 }
- y:
{ x: 5, y: 1 }
- u:
{ x: 6, y: 1 }
- i:
{ x: 7, y: 1 }
- a:
{ x: 0, y: 2 }
- s:
{ x: 1, y: 2 }
- d:
{ x: 2, y: 2 }
- f:
{ x: 3, y: 2 }
- g:
{ x: 4, y: 2 }
- h:
{ x: 5, y: 2 }
- j:
{ x: 6, y: 2 }
- k:
{ x: 7, y: 2 }
- z:
{ x: 0, y: 3 }
- x:
{ x: 1, y: 3 }
- c:
{ x: 2, y: 3 }
- v:
{ x: 3, y: 3 }
- b:
{ x: 4, y: 3 }
- n:
{ x: 5, y: 3 }
- m:
{ x: 6, y: 3 }
- ,:
{ x: 7, y: 3 }