Fix ctrl characters
This commit is contained in:
parent
65b613e6e4
commit
2b0548de46
1 changed files with 2 additions and 8 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -203,19 +203,13 @@ fn main() {
|
||||||
} if window_id == window.id() => {
|
} if window_id == window.id() => {
|
||||||
match (modifiers.logo(), modifiers.ctrl(), modifiers.alt()) {
|
match (modifiers.logo(), modifiers.ctrl(), modifiers.alt()) {
|
||||||
(true, _, _) => {} // Ignore super
|
(true, _, _) => {} // Ignore super
|
||||||
(false, true, _) => {
|
(false, _, true) => {
|
||||||
// Control keys
|
|
||||||
if c >= 'a' && c <= 'z' {
|
|
||||||
notifier.notify(vec![(c as u8) - b'a' + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(false, false, true) => {
|
|
||||||
// Alt keys
|
// Alt keys
|
||||||
let mut buf = [0x1B, 0, 0, 0, 0];
|
let mut buf = [0x1B, 0, 0, 0, 0];
|
||||||
let str = c.encode_utf8(&mut buf[1..]);
|
let str = c.encode_utf8(&mut buf[1..]);
|
||||||
notifier.notify(str.as_bytes().to_vec());
|
notifier.notify(str.as_bytes().to_vec());
|
||||||
}
|
}
|
||||||
(false, false, false) => {
|
(false, _, false) => {
|
||||||
let mut buf = [0, 0, 0, 0];
|
let mut buf = [0, 0, 0, 0];
|
||||||
let str = c.encode_utf8(&mut buf);
|
let str = c.encode_utf8(&mut buf);
|
||||||
notifier.notify(str.as_bytes().to_vec());
|
notifier.notify(str.as_bytes().to_vec());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue