git.s-ol.nu isomorphic-kb-explorer / 2341add
fix keyboard mapping s-ol 4 months ago
2 changed file(s) with 30 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
191191 }
192192
193193 onkeydown = (e) => {
194 if (e.repeat) return;
195
194196 const note = notes.key2midi[e.code];
195197 if (!note) return;
196198 e.preventDefault();
197199 this.setState(({ notes }) => ({ notes: { ...notes, [note]: true } }));
200 this.send(NOTE_ON, note);
198201 }
199202
200203 onkeyup = (e) => {
204 if (e.repeat) return;
205
201206 const note = notes.key2midi[e.code];
202207 if (!note) return;
203208 e.preventDefault();
204209 this.setState(({ notes }) => ({ notes: { ...notes, [note]: false } }));
210 this.send(NOTE_OFF, note);
205211 }
206212
207213 render() {
3737 'Quote': 74,
3838 'Backslash': 76,
3939
40 'KeyQ': 61,
41 'KeyW': 63,
42 'KeyE': 65,
43 'KeyR': 67,
44 'KeyT': 69,
45 'KeyY': 71,
46 'KeyU': 73,
47 'KeyI': 75,
48 'KeyO': 77,
49 'KeyP': 79,
50 'BracketLeft': 81,
51 'BracketRight': 83,
40 'KeyQ': 59,
41 'KeyW': 61,
42 'KeyE': 63,
43 'KeyR': 65,
44 'KeyT': 67,
45 'KeyY': 69,
46 'KeyU': 71,
47 'KeyI': 73,
48 'KeyO': 75,
49 'KeyP': 77,
50 'BracketLeft': 79,
51 'BracketRight': 81,
5252
53 'Digit1': 66,
54 'Digit2': 68,
55 'Digit3': 70,
56 'Digit4': 72,
57 'Digit5': 74,
58 'Digit6': 76,
59 'Digit7': 78,
60 'Digit8': 80,
61 'Digit9': 82,
62 'Digit0': 84,
63 'Minus': 86,
64 'Equal': 88,
53 'Digit1': 64,
54 'Digit2': 66,
55 'Digit3': 68,
56 'Digit4': 70,
57 'Digit5': 72,
58 'Digit6': 74,
59 'Digit7': 76,
60 'Digit8': 78,
61 'Digit9': 80,
62 'Digit0': 82,
63 'Minus': 84,
64 'Equal': 86,
6565 };