Skip to content

Commit e96197e

Browse files
authored
Add files via upload
1 parent 66fc294 commit e96197e

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

QuackHak Studio/quackhak.py

+21-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from PyQt5.QtWidgets import QApplication, QMainWindow, QTextEdit, QMenu, QFileDialog, QAction, QMessageBox, QStatusBar
1212

1313
# QuackHak by CaliNux
14+
# thank you to Wesley for the bug reports!
1415

1516
dark_stylesheet = """
1617
QMainWindow, QMenuBar, QMenuBar::item, QMenu, QMenu::item {
@@ -317,7 +318,14 @@ def loadFreshCode(self):
317318

318319
pyautogui.press('delete')
319320

321+
def disableUserInteraction(self):
322+
self.text_edit.setReadOnly(True)
323+
324+
def enableUserInteraction(self):
325+
self.text_edit.setReadOnly(False)
326+
320327
def executeScript(self):
328+
self.disableUserInteraction()
321329
script_content = self.text_edit.toPlainText()
322330

323331
if not script_content.strip():
@@ -423,7 +431,12 @@ def executeScript(self):
423431
elif line in ["F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"]:
424432
pyautogui.press(line.lower())
425433

434+
time.sleep(1)
435+
436+
self.enableUserInteraction()
437+
426438
def runScript(self):
439+
self.disableUserInteraction()
427440
script_content = self.text_edit.toPlainText()
428441
start_index = script_content.find('powershell')
429442
end_index = script_content.find('ENTER')
@@ -446,6 +459,12 @@ def runScript(self):
446459
time.sleep(1)
447460
pyautogui.press('enter')
448461

462+
time.sleep(1)
463+
464+
self.enableUserInteraction()
465+
466+
467+
449468
def uppercaseKeywords(self, text):
450469
always_upper = ['alt', 'ctrl', 'shift', 'delete', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
451470
'f11', 'f12', 'control', 'up', 'down', 'right', 'left', 'uparrow', 'downarrow', 'rightarrow', 'leftarrow', 'tab', 'enter',
@@ -674,10 +693,10 @@ def main():
674693
window = CodeEditor()
675694
window.setWindowTitle('QuackHak Studio')
676695

677-
window.setGeometry(100, 100, 2100, 500)
696+
window.setGeometry(100, 100, 500, 500)
678697
window.show()
679698
sys.exit(app.exec_())
680699

681700

682701
if __name__ == '__main__':
683-
main()
702+
main()

0 commit comments

Comments
 (0)