Skip to content

Commit

Permalink
Make key 0 target 10th column
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Sep 19, 2024
1 parent 90328c1 commit f664bf6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/chart/ChartManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ export class ChartManager {
(event: KeyboardEvent) => {
if (this.mode != EditMode.Edit) return
if (event.code.startsWith("Digit")) {
const col = parseInt(event.code.slice(5)) - 1
let col = parseInt(event.code.slice(5)) - 1
if (col == -1) col = 9 // 0 key to 10th column
this.endEditing(col)
}
},
Expand All @@ -536,8 +537,9 @@ export class ChartManager {
!event.altKey &&
!event.ctrlKey
) {
const col = parseInt(event.code.slice(5)) - 1
if (col < (this.loadedChart?.gameType.numCols ?? 4) && col > -1) {
let col = parseInt(event.code.slice(5)) - 1
if (col == -1) col = 9 // 0 key to 10th column
if (col < (this.loadedChart?.gameType.numCols ?? 4)) {
this.setNote(col, "key")
event.preventDefault()
event.stopImmediatePropagation()
Expand Down

0 comments on commit f664bf6

Please sign in to comment.