mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	imgui: Fix char input handling
This commit is contained in:
		
							parent
							
								
									cb8677b310
								
							
						
					
					
						commit
						478032ad28
					
				
					 2 changed files with 10 additions and 7 deletions
				
			
		|  | @ -5231,8 +5231,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) | |||
| #if ENABLE_IMGUI | ||||
|     auto imgui = wxGetApp().imgui(); | ||||
|     if (imgui->update_key_data(evt)) { | ||||
|         return; | ||||
|         render(); | ||||
|         return; | ||||
|     } | ||||
| #endif // ENABLE_IMGUI
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -124,6 +124,9 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt) | |||
|         if (key != 0) { | ||||
|             io.AddInputCharacter(key); | ||||
|         } | ||||
| 
 | ||||
|         new_frame(); | ||||
|         return want_keyboard() || want_text_input(); | ||||
|     } else { | ||||
|         // Key up/down event
 | ||||
|         int key = evt.GetKeyCode(); | ||||
|  | @ -134,13 +137,13 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt) | |||
|         io.KeyCtrl = evt.ControlDown(); | ||||
|         io.KeyAlt = evt.AltDown(); | ||||
|         io.KeySuper = evt.MetaDown(); | ||||
|     } | ||||
| 
 | ||||
|     // XXX: Unfortunatelly this seems broken due to some interference with wxWidgets,
 | ||||
|     // we have to return true always (perform re-render).
 | ||||
|     // new_frame();
 | ||||
|     // return want_keyboard() || want_text_input();
 | ||||
|     return true; | ||||
|         // XXX: Unfortunatelly this seems broken due to some interference with wxWidgets,
 | ||||
|         // we have to return true always (perform re-render).
 | ||||
|         // new_frame();
 | ||||
|         // return want_keyboard() || want_text_input();
 | ||||
|         return true; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void ImGuiWrapper::new_frame() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vojtech Kral
						Vojtech Kral