Skip to content

Commit

Permalink
Use the correct isomorphic coordinates on virtual QWERTY
Browse files Browse the repository at this point in the history
ref #452
  • Loading branch information
frostburn committed Feb 19, 2024
1 parent c300937 commit ca3ed85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## (UNRELEASED)
* Documentation: Move changelog to a dedicated file [#556](https://github.com/xenharmonic-devs/scale-workshop/issues/556)
* Bug fix: Fix the bottom row of virtual QWERTY being offset by one [#452](https://github.com/xenharmonic-devs/scale-workshop/issues/452)

## 2.3.6
* Feature: Be more informative about why vals or commas do not span a rank-2 temperament [#540](https://github.com/xenharmonic-devs/scale-workshop/issues/540)
Expand Down
5 changes: 3 additions & 2 deletions src/components/VirtualTypingKeyboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue'
import { mmod } from 'xen-dev-utils'
import type { Keyboard, CoordinateKeyboardEvent } from 'isomorphic-qwerty'
import { CODES_LAYER_1 } from 'isomorphic-qwerty'
import { CODES_LAYER_1, COORDS_BY_CODE } from 'isomorphic-qwerty'
import { LEFT_MOUSE_BTN } from '@/constants'
/** Unimplemented features:
Expand Down Expand Up @@ -78,7 +78,8 @@ const rows = computed(() => {
}
let index
if (props.keyboardMode === 'isomorphic') {
index = base + i * horizontal + (2 - j) * vertical
const [x, y] = COORDS_BY_CODE.get(code)!
index = base + x * horizontal + (2 - y) * vertical
} else {
index = mapping!.get(code)
}
Expand Down

0 comments on commit ca3ed85

Please sign in to comment.