Add more script specific fallbacks

This commit is contained in:
Jeremy Soller 2022-10-13 13:26:06 -06:00
parent f91cb3ce0f
commit fec418b3b1
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
4 changed files with 65 additions and 26 deletions

View file

@ -262,26 +262,36 @@ fn main() {
orbclient::K_PGUP if event.pressed => {
scroll -= window_lines;
buffer.redraw = true;
}
},
orbclient::K_PGDN if event.pressed => {
scroll += window_lines;
buffer.redraw = true;
}
},
orbclient::K_0 if event.pressed && ctrl_pressed => {
font_size_i = font_size_default;
buffer.set_font_size(font_sizes[font_size_i].0 * display_scale);
}
},
orbclient::K_MINUS if event.pressed && ctrl_pressed => {
if font_size_i > 0 {
font_size_i -= 1;
buffer.set_font_size(font_sizes[font_size_i].0 * display_scale);
}
}
},
orbclient::K_EQUALS if event.pressed && ctrl_pressed => {
if font_size_i + 1 < font_sizes.len() {
font_size_i += 1;
buffer.set_font_size(font_sizes[font_size_i].0 * display_scale);
}
},
orbclient::K_D if event.pressed && ctrl_pressed => {
// Debug by shaping whole buffer
log::info!("Shaping rest of buffer");
let instant = Instant::now();
buffer.shape_until(i32::max_value());
let elapsed = instant.elapsed();
log::info!("Shaped rest of buffer in {:?}", elapsed);
}
_ => (),
},