Skip to content

Commit

Permalink
fix: re click button keymap and keyinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
DriftKingTW committed Dec 18, 2024
1 parent 0f0082d commit 89ea014
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ const KEYBOARD_LAYOUT: KeyboardLayout[] = [
{ row: 4, col: 6, size: "rotary" },
];
const RE_ROW_LIST = [4];
const RE_COL_LIST = [6];
const RE_LIST = [{ row: 4, col: 6 }];
// Default objects
const defaultKey: Key = readonly({
Expand Down Expand Up @@ -703,10 +702,15 @@ const updaterotaryEncoder = (rotaryEncoder: any) => {
const data = JSON.parse(JSON.stringify(rotaryEncoder));
// Map rotary encoder button data to default key matrix
combinedConfig.onBoardRotaryEncoder = data;
combinedConfig.keyConfig.map((layer: ConfigJSONObject, index) => {
RE_ROW_LIST.forEach((row, col) => {
layer.keymap[row][RE_COL_LIST[col]] = data[index].rotaryMap[0];
layer.keyInfo[row][RE_COL_LIST[col]] = data[index].rotaryInfo[0];
updateOutputData();
configJsonArray.forEach((keyConfig: ConfigJSONObject, index) => {
RE_LIST.forEach((re) => {
keyConfig.keymap[re.row][re.col] = data[index].rotaryMap[0];
keyConfig.keyInfo[re.row][re.col] = data[index].rotaryInfo[0];
layout[re.row][re.col].keyStroke =
data[currentLayoutIndex.value].rotaryMap[0];
layout[re.row][re.col].keyInfo =
data[currentLayoutIndex.value].rotaryInfo[0];
});
});
updateOutputData();
Expand Down

0 comments on commit 89ea014

Please sign in to comment.