Skip to content

Commit

Permalink
Merge pull request imgui-rs#106 from malikolivier/master
Browse files Browse the repository at this point in the history
lib.rs: Add function to know whever Ctrl, Alt or Shift are pressed
  • Loading branch information
Gekkio authored Mar 15, 2018
2 parents d3261f1 + 42be8d6 commit e90a92c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e90a92c

Please sign in to comment.