submission: Take over virtual_keyboard handling

This commit is contained in:
Dorota Czaplejewicz
2020-01-12 20:09:05 +00:00
parent aafecfac02
commit 326bb9319f
14 changed files with 147 additions and 77 deletions

View File

@ -1,9 +1,11 @@
/*! Managing the events belonging to virtual-keyboard interface. */
use ::keyboard::{ KeyCode, PressType };
use ::layout::c::LevelKeyboard;
/// Gathers stuff defined in C or called by C
pub mod c {
use super::*;
use std::os::raw::c_void;
#[repr(transparent)]
@ -12,14 +14,17 @@ pub mod c {
#[no_mangle]
extern "C" {
/// Checks if point falls within bounds,
/// which are relative to origin and rotated by angle (I think)
pub fn eek_virtual_keyboard_v1_key(
virtual_keyboard: ZwpVirtualKeyboardV1,
timestamp: u32,
keycode: u32,
press: u32,
);
pub fn eek_virtual_keyboard_update_keymap(
virtual_keyboard: ZwpVirtualKeyboardV1,
keyboard: LevelKeyboard,
);
}
}
@ -64,4 +69,13 @@ impl VirtualKeyboard {
}
}
}
pub fn update_keymap(&self, keyboard: LevelKeyboard) {
unsafe {
c::eek_virtual_keyboard_update_keymap(
self.0,
keyboard,
);
}
}
}