Skip to content

Commit

Permalink
Add enter shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny committed Mar 15, 2023
1 parent 4b15887 commit d0cc317
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chatgpt",
"private": true,
"version": "0.3.0",
"version": "0.4.0",
"scripts": {
"dev": "next dev -p 1420",
"build": "next build && next export -o dist",
Expand Down
Binary file modified releases/chatgpt.dmg
Binary file not shown.
8 changes: 8 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ fn main() {
}
document.head.appendChild(style);
document.body.classList.add('arrow');
document.addEventListener("keydown", e => {
if (window.location.href.includes("https://chat.openai.com/chat") && e.code == "Enter" && e.target.tagName == "TEXTAREA") {
if (e.target.nextSibling.tagName == "BUTTON" && e.shiftKey == false) {
e.preventDefault()
e.target.nextSibling.click()
}
}
})
"#;

let open = CustomMenuItem::new("open".to_string(), "Open").accelerator("Cmd+Shift+O");
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "chatgpt",
"version": "0.3.0"
"version": "0.4.0"
},
"tauri": {
"allowlist": {
Expand Down

0 comments on commit d0cc317

Please sign in to comment.