Skip to content

Commit 687c8d3

Browse files
committed
Add Left Ctrl and C to blacklisted keys when choosing a key, you can specify them manualy NOT RECOMENDED.
1 parent 21e3665 commit 687c8d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,14 @@ fn choose_key(input_device: &InputDevice, name: &str) -> u16 {
509509

510510
println!("\t{}", KeyCode(events[0].code));
511511

512+
if matches!(
513+
events[0].code as i32,
514+
input_linux::sys::KEY_LEFTCTRL | input_linux::sys::KEY_C
515+
) {
516+
println!("\x1B[1;31mThis key is blacklisted\x1B[22;39m");
517+
std::process::exit(10);
518+
}
519+
512520
if choose_yes("You want to choose this", true) {
513521
break events[0].code;
514522
}

0 commit comments

Comments
 (0)