From 83bb97157f99d3d8c68c063730950f92618f0a44 Mon Sep 17 00:00:00 2001 From: Haobo Gu Date: Wed, 15 Nov 2023 16:11:25 +0800 Subject: [PATCH] fix(via): fix keymap read error Signed-off-by: Haobo Gu --- rmk/src/via/process.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rmk/src/via/process.rs b/rmk/src/via/process.rs index 86bb2054..c4bf427e 100644 --- a/rmk/src/via/process.rs +++ b/rmk/src/via/process.rs @@ -156,7 +156,6 @@ pub fn process_via_packet< let offset = BigEndian::read_u16(&report.output_data[1..3]); // size <= 28 let size = report.output_data[3]; - // FIXME: Cannot get complete keymap info!("Getting keymap buffer, offset: {}, size: {}", offset, size); let mut idx = 4; keymap @@ -164,7 +163,7 @@ pub fn process_via_packet< .iter() .flatten() .flatten() - .skip(offset as usize) + .skip((offset / 2) as usize) .take((size / 2) as usize) .for_each(|a| { let kc = to_via_keycode(*a);