Skip to content

Commit

Permalink
fix(via): fix keymap read error
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Nov 15, 2023
1 parent 676de3f commit 83bb971
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rmk/src/via/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ 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
.layers
.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);
Expand Down

0 comments on commit 83bb971

Please sign in to comment.