From af21b30afc0a28f63922d338ba33da31d4368556 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 4 May 2022 18:50:24 -0600 Subject: [PATCH] Make second mouse button send dit on dah key For #43 --- static/index.html | 6 +++--- static/inputs.mjs | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/static/index.html b/static/index.html index 9a6623a..6d37aef 100644 --- a/static/index.html +++ b/static/index.html @@ -173,19 +173,19 @@ Left Button - LB + L1 gamepad Top Button - RB + R1 - Second mouse button: Dah + Second mouse button switches dah and dit diff --git a/static/inputs.mjs b/static/inputs.mjs index 0d6c42a..17378a5 100644 --- a/static/inputs.mjs +++ b/static/inputs.mjs @@ -29,11 +29,17 @@ export class HTML extends Input{ let begin = event.type.endsWith("down") || event.type.endsWith("start") if (event.target.id == "dah") { - this.keyer.Dah(begin) - } else if ((event.target.id == "dit") && (event.button == 2)) { - this.keyer.Dah(begin) + if (event.button == 2) { + this.keyer.Dit(begin) + } else { + this.keyer.Dah(begin) + } } else if (event.target.id == "dit") { - this.keyer.Dit(begin) + if (event.button == 2) { + this.keyer.Dah(begin) + } else { + this.keyer.Dit(begin) + } } else if (event.target.id == "key") { this.keyer.Straight(begin) } else {