mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-12 12:13:08 +00:00
Add comments
This commit is contained in:
parent
c8d39910ab
commit
70cddae454
@ -112,12 +112,15 @@ impl InputParser {
|
|||||||
let mut bare_event = mevent.bstate & ((1 << 25) - 1);
|
let mut bare_event = mevent.bstate & ((1 << 25) - 1);
|
||||||
|
|
||||||
let mut event = None;
|
let mut event = None;
|
||||||
|
// ncurses encodes multiple events in the same value.
|
||||||
while bare_event != 0 {
|
while bare_event != 0 {
|
||||||
let single_event = 1 << bare_event.trailing_zeros();
|
let single_event = 1 << bare_event.trailing_zeros();
|
||||||
bare_event ^= single_event;
|
bare_event ^= single_event;
|
||||||
|
|
||||||
// Process single_event
|
// Process single_event
|
||||||
on_mouse_event(single_event as i32, |e| {
|
on_mouse_event(single_event as i32, |e| {
|
||||||
|
// Keep one event for later,
|
||||||
|
// send the rest through the channel.
|
||||||
if event.is_none() {
|
if event.is_none() {
|
||||||
event = Some(e);
|
event = Some(e);
|
||||||
} else {
|
} else {
|
||||||
@ -271,6 +274,7 @@ impl backend::Backend for Backend {
|
|||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
// TODO: use an atomic boolean to stop the thread on finish
|
// TODO: use an atomic boolean to stop the thread on finish
|
||||||
while running.load(Ordering::Relaxed) {
|
while running.load(Ordering::Relaxed) {
|
||||||
|
// This sends events to the event sender.
|
||||||
parser.parse_next();
|
parser.parse_next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user