Merge pull request #106 from malikolivier/master

lib.rs: Add function to know whever Ctrl, Alt or Shift are pressed
This commit is contained in:
Joonas Javanainen 2018-03-15 21:17:57 +02:00 committed by GitHub
commit e90a92c582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,14 +202,26 @@ impl ImGui {
let io = self.io_mut();
io.mouse_draw_cursor = value;
}
pub fn key_ctrl(&self) -> bool {
let io = self.io();
io.key_ctrl
}
pub fn set_key_ctrl(&mut self, value: bool) {
let io = self.io_mut();
io.key_ctrl = value;
}
pub fn key_shift(&self) -> bool {
let io = self.io();
io.key_shift
}
pub fn set_key_shift(&mut self, value: bool) {
let io = self.io_mut();
io.key_shift = value;
}
pub fn key_alt(&self) -> bool {
let io = self.io();
io.key_alt
}
pub fn set_key_alt(&mut self, value: bool) {
let io = self.io_mut();
io.key_alt = value;