Skip to content

Commit

Permalink
moving keyboard touch setting event to ended event
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivy committed Aug 4, 2024
1 parent 6eaa8e0 commit 184ab46
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub fn process_input_system(
#[cfg(target_arch = "wasm32")]
for context in context_params.contexts.iter() {
let platform_output = &context.egui_output.platform_output;
if platform_output.mutable_text_under_cursor || platform_output.ime.is_some() {
if platform_output.ime.is_some() || platform_output.mutable_text_under_cursor {
editing_text = true;
break;
}
Expand Down Expand Up @@ -414,6 +414,15 @@ pub fn process_input_system(
.egui_input
.events
.push(egui::Event::PointerGone);
#[cfg(target_arch = "wasm32")]
match VIRTUAL_KEYBOARD_GLOBAL.lock() {
Ok(mut touch_info) => {
touch_info.editing_text = editing_text;
}
Err(poisoned) => {
let _unused = poisoned.into_inner();
}
};
}
bevy::input::touch::TouchPhase::Canceled => {
window_context.ctx.pointer_touch_id = None;
Expand All @@ -423,15 +432,6 @@ pub fn process_input_system(
.push(egui::Event::PointerGone);
}
}
#[cfg(target_arch = "wasm32")]
match VIRTUAL_KEYBOARD_GLOBAL.lock() {
Ok(mut touch_info) => {
touch_info.editing_text = editing_text;
}
Err(poisoned) => {
let _unused = poisoned.into_inner();
}
};
}
}

Expand Down

0 comments on commit 184ab46

Please sign in to comment.