diff --git a/CPStyling/init.lua b/CPStyling/init.lua index 43106bc..9c7250d 100644 --- a/CPStyling/init.lua +++ b/CPStyling/init.lua @@ -447,4 +447,39 @@ function CPStyle.fileExists(filename) if (f~=nil) then io.close(f) return true else return false end end +CPStyle.Input = { enable = false } + +function CPStyle.Input:Enable(state) + if state == nil then + self.enable = not self.enbale + else + self.enable = state + end +end + +function CPStyle.Input:Register() + if self.enable then + CPS.colorBegin("WindowBg", theme.Hidden) + CPS.colorBegin("FrameBg", theme.Hidden) + CPS.colorBegin("Text", theme.Hidden) + CPS.colorBegin("NavHighlight", theme.Hidden) + CPS.colorBegin("Border", theme.Hidden) + ImGui.Begin("##CPStyle.Input", ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoResize) + ImGui.SetKeyboardFocusHere() + self.keypress, self.pressed = ImGui.InputText("##keyboardinput", "", 100) + if self.pressed then ImGui.SetKeyboardFocusHere() end + ImGui.InputText("##dummy", "", 100) + ImGui.End() + CPS.colorEnd(5) + end +end + +function CPStyle.Input:GetKeyPress() + if self.keypress == "" then + return nil + else + return self.keypress + end +end + return CPStyle