presses: Move press handling to Rust

This fixes some rendering things which would happen with multiple state-sharing buttons. It also removes some interfaces exposing rows, views, layouts, and buttons, bringing the code closer to removing them from the FFI entirely.
This commit is contained in:
Dorota Czaplejewicz
2019-10-17 13:33:23 +00:00
parent 3b6c19401c
commit c99efc430c
15 changed files with 626 additions and 611 deletions

View File

@ -14,7 +14,7 @@ use std::vec::Vec;
use xkbcommon::xkb;
use ::keyboard::{
KeyState,
KeyState, PressType,
generate_keymap, generate_keycodes, FormattingError
};
use ::resources;
@ -346,7 +346,7 @@ impl Layout {
(
name.into(),
KeyState {
pressed: false,
pressed: PressType::Released,
locked: false,
keycodes,
action,
@ -407,6 +407,8 @@ impl Layout {
CString::new(keymap_str)
.expect("Invalid keymap string generated")
},
locked_keys: HashSet::new(),
pressed_keys: HashSet::new(),
})
}
}