mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 21:21:06 +01:00 
			
		
		
		
	Added ImGuiKeyModFlags. Added additional checks in EndFrame() to verify that io.KeyXXX values have not been tampered with between NewFrame() and EndFrame().
This commit is contained in:
		
							
								
								
									
										12
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -168,6 +168,7 @@ typedef int ImGuiDragDropFlags;     // -> enum ImGuiDragDropFlags_   // Flags: f | ||||
| typedef int ImGuiFocusedFlags;      // -> enum ImGuiFocusedFlags_    // Flags: for IsWindowFocused() | ||||
| typedef int ImGuiHoveredFlags;      // -> enum ImGuiHoveredFlags_    // Flags: for IsItemHovered(), IsWindowHovered() etc. | ||||
| typedef int ImGuiInputTextFlags;    // -> enum ImGuiInputTextFlags_  // Flags: for InputText(), InputTextMultiline() | ||||
| typedef int ImGuiKeyModFlags;       // -> enum ImGuiKeyModFlags_     // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super) | ||||
| typedef int ImGuiSelectableFlags;   // -> enum ImGuiSelectableFlags_ // Flags: for Selectable() | ||||
| typedef int ImGuiTabBarFlags;       // -> enum ImGuiTabBarFlags_     // Flags: for BeginTabBar() | ||||
| typedef int ImGuiTabItemFlags;      // -> enum ImGuiTabItemFlags_    // Flags: for BeginTabItem() | ||||
| @@ -997,6 +998,16 @@ enum ImGuiKey_ | ||||
|     ImGuiKey_COUNT | ||||
| }; | ||||
|  | ||||
| // To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/back-end) | ||||
| enum ImGuiKeyModFlags_ | ||||
| { | ||||
|     ImGuiKeyModFlags_None       = 0, | ||||
|     ImGuiKeyModFlags_Ctrl       = 1 << 0, | ||||
|     ImGuiKeyModFlags_Shift      = 1 << 1, | ||||
|     ImGuiKeyModFlags_Alt        = 1 << 2, | ||||
|     ImGuiKeyModFlags_Super      = 1 << 3 | ||||
| }; | ||||
|  | ||||
| // Gamepad/Keyboard directional navigation | ||||
| // Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays. | ||||
| // Gamepad:  Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Back-end: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). | ||||
| @@ -1496,6 +1507,7 @@ struct ImGuiIO | ||||
|     // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed! | ||||
|     //------------------------------------------------------------------ | ||||
|  | ||||
|     ImGuiKeyModFlags KeyMods;                   // Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame() | ||||
|     ImVec2      MousePosPrev;                   // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid) | ||||
|     ImVec2      MouseClickedPos[5];             // Position at time of clicking | ||||
|     double      MouseClickedTime[5];            // Time of last click (used to figure out double-click) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user