Updated to latest rustc and rustbox.
This commit is contained in:
parent
1d6a8cb107
commit
57f013bd46
10
Cargo.toml
10
Cargo.toml
|
@ -11,17 +11,17 @@ path = "src/main.rs"
|
||||||
[dependencies.ropey]
|
[dependencies.ropey]
|
||||||
git = "https://github.com/cessen/ropey.git"
|
git = "https://github.com/cessen/ropey.git"
|
||||||
|
|
||||||
[dependencies.sdl2]
|
|
||||||
git = "https://github.com/AngryLawyer/rust-sdl2.git"
|
|
||||||
|
|
||||||
[dependencies.docopt]
|
[dependencies.docopt]
|
||||||
git = "https://github.com/docopt/docopt.rs.git"
|
git = "https://github.com/docopt/docopt.rs.git"
|
||||||
|
|
||||||
[dependencies.rustbox]
|
[dependencies.rustbox]
|
||||||
git = "https://github.com/gchp/rustbox.git"
|
git = "https://github.com/gchp/rustbox.git"
|
||||||
|
|
||||||
[dependencies.freetype-rs]
|
#[dependencies.sdl2]
|
||||||
git = "https://github.com/PistonDevelopers/freetype-rs.git"
|
#git = "https://github.com/AngryLawyer/rust-sdl2.git"
|
||||||
|
|
||||||
|
#[dependencies.freetype-rs]
|
||||||
|
#git = "https://github.com/PistonDevelopers/freetype-rs.git"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustc-serialize = "0.3.0"
|
rustc-serialize = "0.3.0"
|
||||||
|
|
|
@ -108,10 +108,10 @@ impl TermUI {
|
||||||
// program doesn't loop like crazy, but then continue pulling
|
// program doesn't loop like crazy, but then continue pulling
|
||||||
// events in a non-blocking way until we run out of events
|
// events in a non-blocking way until we run out of events
|
||||||
// to handle.
|
// to handle.
|
||||||
let mut e = self.rb.poll_event(); // Block until we get an event
|
let mut e = self.rb.poll_event(true); // Block until we get an event
|
||||||
loop {
|
loop {
|
||||||
match e {
|
match e {
|
||||||
Ok(rustbox::Event::KeyEvent(_, key, character)) => {
|
Ok(rustbox::Event::KeyEventRaw(_, key, character)) => {
|
||||||
//println!(" {} {} {}", modifier, key, character);
|
//println!(" {} {} {}", modifier, key, character);
|
||||||
match key {
|
match key {
|
||||||
K_CTRL_Q => {
|
K_CTRL_Q => {
|
||||||
|
@ -200,7 +200,7 @@ impl TermUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e = self.rb.peek_event(Duration::milliseconds(0)); // Get next event (if any)
|
e = self.rb.peek_event(Duration::milliseconds(0), true); // Get next event (if any)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some((h, w)) = resize {
|
if let Some((h, w)) = resize {
|
||||||
|
@ -245,10 +245,10 @@ impl TermUI {
|
||||||
// program doesn't loop like crazy, but then continue pulling
|
// program doesn't loop like crazy, but then continue pulling
|
||||||
// events in a non-blocking way until we run out of events
|
// events in a non-blocking way until we run out of events
|
||||||
// to handle.
|
// to handle.
|
||||||
let mut e = self.rb.poll_event(); // Block until we get an event
|
let mut e = self.rb.poll_event(true); // Block until we get an event
|
||||||
loop {
|
loop {
|
||||||
match e {
|
match e {
|
||||||
Ok(rustbox::Event::KeyEvent(_, key, character)) => {
|
Ok(rustbox::Event::KeyEventRaw(_, key, character)) => {
|
||||||
match key {
|
match key {
|
||||||
K_ESC => {
|
K_ESC => {
|
||||||
cancel = true;
|
cancel = true;
|
||||||
|
@ -288,7 +288,7 @@ impl TermUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e = self.rb.peek_event(Duration::milliseconds(0)); // Get next event (if any)
|
e = self.rb.peek_event(Duration::milliseconds(0), true); // Get next event (if any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user