From c8307e1763e2e93fcd856f258d5b36e8e4e7a8bc Mon Sep 17 00:00:00 2001 From: sago35 Date: Mon, 5 Feb 2024 21:58:24 +0900 Subject: [PATCH] Add suport for Vial's Matrix tester --- via.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/via.go b/via.go index 2ccda8a..e29a13a 100644 --- a/via.go +++ b/via.go @@ -166,6 +166,16 @@ func rxHandler2(b []byte) bool { // id_get_keyboard_value Changed = false Changed2 = false + switch txb[1] { + case 0x03: + cols := device.GetMaxKeyCount() + rowSize := (cols + 7) / 8 + for _, v := range device.pressed { + row, _, col := decKey(v) + idx := 2 + row*rowSize + (rowSize - 1) - col/8 + txb[idx] |= byte(1 << (col % 8)) + } + } case 0x05: //fmt.Printf("XXXXXXXXX % X\n", b) //Keys[b[1]][b[2]][b[3]] = Keycode((uint16(b[4]) << 8) + uint16(b[5]))