mirror of https://github.com/nealey/vail.git
parent
d1edd13cc3
commit
6e20cc510f
|
@ -53,9 +53,7 @@ export class Keyboard extends Input{
|
|||
// Listen for keystrokes
|
||||
document.addEventListener("keydown", e => this.keyboard(e))
|
||||
document.addEventListener("keyup", e => this.keyboard(e))
|
||||
|
||||
// VBand: the keyboard input needs to know whether vband's "left" should be dit or straight
|
||||
this.iambic = false
|
||||
window.addEventListener("blur", e => this.loseFocus(e))
|
||||
}
|
||||
|
||||
keyboard(event) {
|
||||
|
@ -103,6 +101,21 @@ export class Keyboard extends Input{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
loseFocus(event) {
|
||||
if (this.ditDown) {
|
||||
this.keyer.Key(0, false)
|
||||
this.ditDown = false
|
||||
}
|
||||
if (this.dahDown) {
|
||||
this.keyer.Key(1, false)
|
||||
this.dahDown = false
|
||||
}
|
||||
if (this.straightDown) {
|
||||
this.keyer.key(2, false)
|
||||
this.straightDown = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class MIDI extends Input{
|
||||
|
|
Loading…
Reference in New Issue