Skip to content

Commit

Permalink
Simplified Esc key handler by removing reliance on chatgpt.isIdle()
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jan 31, 2025
1 parent 1b09b38 commit 65854a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chatgpt-widescreen/chromium/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
// Add KEY LISTENER to enable flag on F11 + stop generating text on ESC
document.addEventListener('keydown', event => {
if ((event.key == 'F11' || event.keyCode == 122) && !config.fullScreen) config.f11 = true
else if ((event.key.startsWith('Esc') || event.keyCode == 27) && !chatgpt.isIdle()) chatgpt.stop()
else if ((event.key.startsWith('Esc') || event.keyCode == 27)) try { chatgpt.stop() } catch (err) {}
})

})()
2 changes: 1 addition & 1 deletion chatgpt-widescreen/firefox/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
// Add KEY LISTENER to enable flag on F11 + stop generating text on ESC
document.addEventListener('keydown', event => {
if ((event.key == 'F11' || event.keyCode == 122) && !config.fullScreen) config.f11 = true
else if ((event.key.startsWith('Esc') || event.keyCode == 27) && !chatgpt.isIdle()) chatgpt.stop()
else if ((event.key.startsWith('Esc') || event.keyCode == 27)) try { chatgpt.stop() } catch (err) {}
})

})()
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
// @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-perplexity.ai + poe.com!
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2025.1.31
// @version 2025.1.31.1
// @license MIT
// @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e
// @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e
Expand Down Expand Up @@ -882,7 +882,7 @@
// Add KEY LISTENER to enable flag on F11 + stop generating text on ESC
document.addEventListener('keydown', event => {
if ((event.key == 'F11' || event.keyCode == 122) && !config.fullScreen) config.f11 = true
else if ((event.key.startsWith('Esc') || event.keyCode == 27) && !chatgpt.isIdle()) chatgpt.stop()
else if ((event.key.startsWith('Esc') || event.keyCode == 27)) try { chatgpt.stop() } catch (err) {}
})

})()

0 comments on commit 65854a8

Please sign in to comment.