Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result = None
del result
# Append result to history
self.cli_history.append(self.input)
# Clear variable to get used once more
self.input = None
self.input = ""
# Push style of the button
imgui.pop_style_color(1)
# On the same line we want our next object
imgui.same_line()
# Create a style for a new button
imgui.push_style_color(imgui.COLOR_BUTTON, *self.KEY_COLOR_BGRAY)
# Create a button "Settings"
if imgui.button("S", width=40, height=40):
# If the keyboard was toggled turn it off
if self.keyboard_toggled:
self.keyboard_toggled = False
self.CAPS = False
self.SYS = False
# Finally render the settings
self.toggle()
# Push style of the button
imgui.pop_style_color(1)
imgui.end()
imgui.render()
self.renderer.render()
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
imgui.push_style_var(imgui.STYLE_WINDOW_PADDING, imgui.Vec2(5, 5))
imgui.push_style_var(imgui.STYLE_WINDOW_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_CHILD_WINDOW_ROUNDING, 0)
imgui.push_style_var(imgui.STYLE_FRAME_PADDING, imgui.Vec2(11, 5))
imgui.push_style_var(imgui.STYLE_FRAME_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_ITEM_SPACING, imgui.Vec2(10, 10))
imgui.push_style_var(imgui.STYLE_ITEM_INNER_SPACING, imgui.Vec2(5, 5))
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
Key: The key of the key
same_line: True or False, for if the next key should be on the same line
optional:
color: set color
"""
if same_line:
imgui.same_line()
if self.CAPS:
key = key.upper()
try:
if default == 'SHIFT' or default == 'SYS' or default == 'TAB':
imgui.push_style_color(imgui.COLOR_BUTTON, *self.KEY_COLOR_BGRAY)
else:
imgui.push_style_color(imgui.COLOR_BUTTON, *self.KEY_COLOR_LGRAY)
#imgui.push_style_color(imgui.COLOR_TEXT, *self.KEY_COLOR_ORANGE)
if imgui.button(key, width=80, height=60):
if default is None:
if self.input == '':
self.input = key
else:
self.input = self.input + key
elif default == 'SHIFT':
self.shift_key()
elif default == 'SYS':
self.sys_key()
elif default == 'TAB':
if self.TAB == False:
self.input = self.input.replace('>>>', '>>>\n')
self.TAB = True
def push_settings():
imgui.push_style_var(imgui.STYLE_WINDOW_PADDING, imgui.Vec2(5, 5))
imgui.push_style_var(imgui.STYLE_WINDOW_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_CHILD_WINDOW_ROUNDING, 0)
imgui.push_style_var(imgui.STYLE_FRAME_PADDING, imgui.Vec2(11, 5))
imgui.push_style_var(imgui.STYLE_FRAME_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_ITEM_SPACING, imgui.Vec2(10, 10))
imgui.push_style_var(imgui.STYLE_ITEM_INNER_SPACING, imgui.Vec2(5, 5))
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
imgui.push_style_var(imgui.STYLE_CHILD_WINDOW_ROUNDING, 0)
imgui.push_style_var(imgui.STYLE_FRAME_PADDING, imgui.Vec2(11, 5))
imgui.push_style_var(imgui.STYLE_FRAME_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_ITEM_SPACING, imgui.Vec2(10, 10))
imgui.push_style_var(imgui.STYLE_ITEM_INNER_SPACING, imgui.Vec2(5, 5))
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
imgui.push_style_var(imgui.STYLE_ITEM_INNER_SPACING, imgui.Vec2(5, 5))
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)
"""
for i in range(5):
self.placeholder()
imgui.same_line()
self.placeholder()
"""
NEW ROW STARTS HERE ROW #5
"""
# TESTS
"""
Give code for a long list, test long outputs
"""
# Give a style to the button
imgui.push_style_color(imgui.COLOR_BUTTON, *self.KEY_COLOR_LGRAY)
# Create a button "Long Output"
if imgui.button("Long Output", width=self.BTN_WIDTH, height=self.BTN_HEIGHT):
# Execute code when button is pressed
self.input = "dpaste:>>070KVYA"
# push style
imgui.pop_style_color(1)
imgui.same_line()
"""
Test SSL
"""
# Give a style to the button
imgui.push_style_color(imgui.COLOR_BUTTON, *self.KEY_COLOR_LGRAY)
# Create a button "Test SSL"
if imgui.button("Test SSL", width=self.BTN_WIDTH, height=self.BTN_HEIGHT):
def push_settings():
imgui.push_style_var(imgui.STYLE_WINDOW_PADDING, imgui.Vec2(5, 5))
imgui.push_style_var(imgui.STYLE_WINDOW_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_CHILD_WINDOW_ROUNDING, 0)
imgui.push_style_var(imgui.STYLE_FRAME_PADDING, imgui.Vec2(11, 5))
imgui.push_style_var(imgui.STYLE_FRAME_ROUNDING, 5)
imgui.push_style_var(imgui.STYLE_ITEM_SPACING, imgui.Vec2(10, 10))
imgui.push_style_var(imgui.STYLE_ITEM_INNER_SPACING, imgui.Vec2(5, 5))
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_TEXT, 0.00, 0.00, 0.00, 1.00)
imgui.push_style_color(imgui.COLOR_WINDOW_BACKGROUND, 0.93, 0.94, 0.95, 1.00)
imgui.push_style_color(imgui.COLOR_POPUP_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND, 0.47, 0.56, 0.61, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_HOVERED, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_FRAME_BACKGROUND_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_COLLAPSED, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_TITLE_BACKGROUND_ACTIVE, 0.39, 0.71, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_MENUBAR_BACKGROUND, 0.26, 0.65, 0.96, 1.00)
imgui.push_style_color(imgui.COLOR_SCROLLBAR_GRAB_ACTIVE, 0.40, 0.40, 0.80, 0.40)
imgui.push_style_color(imgui.COLOR_COMBO_BACKGROUND, 0.40, 0.50, 0.55, 1.00)
imgui.push_style_color(imgui.COLOR_BUTTON, 0.00, 0.00, 0.00, 0.07)
imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, 0.90, 0.90, 0.90, 0.50)
imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, 0.54, 0.63, 0.68, 1.00)
imgui.push_style_color(imgui.COLOR_HEADER, 0.00, 0.00, 0.00, 0.00)
imgui.push_style_color(imgui.COLOR_HEADER_HOVERED, 0.05, 0.28, 0.63, 0.20)
imgui.push_style_color(imgui.COLOR_HEADER_ACTIVE, 0.05, 0.28, 0.63, 0.26)