Skip to content

Commit

Permalink
feat: copy shortcuts: Shift Ctrl C for copy last, Shift Ctrl A for co…
Browse files Browse the repository at this point in the history
…py all (#454)
  • Loading branch information
ellvix authored Mar 31, 2024
1 parent bd8e359 commit 486076c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,14 +1134,19 @@ class ChatLLM {
}
} else if (e.type == 'keyup') {
// check for alt shift c
if (e.key == 'C' && (e.altKey || e.metaKey) && e.shiftKey) {
if (e.key == 'C' && (e.ctrlKey || e.metaKey) && e.shiftKey) {
e.preventDefault();
// get the last message
let elem = document.querySelector(
'#chatLLM_chat_history > .chatLLM_message_other:last-of-type'
);
if (elem) {
text = elem.innerHTML;
}
} else if (e.key == 'A' && (e.ctrlKey || e.metaKey) && e.shiftKey) {
e.preventDefault();
// get html of the full chat history
text = document.getElementById('chatLLM_chat_history').innerHTML;
}
}

Expand Down

0 comments on commit 486076c

Please sign in to comment.