mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Add Keyboard shortcuts to navigate in Khoj Desktop
This commit is contained in:
parent
6c1861b319
commit
3a75838196
1 changed files with 17 additions and 0 deletions
|
@ -15,6 +15,23 @@
|
|||
<script src="./utils.js"></script>
|
||||
<script src="chatutils.js"></script>
|
||||
<script>
|
||||
// Add keyboard shortcuts to the chat view
|
||||
window.addEventListener("keydown", function(event) {
|
||||
// If enter key is pressed, send the message
|
||||
if (event.key === "Enter" && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
chat();
|
||||
// If ^O then Open the chat sessions panel
|
||||
} else if (event.key === "o" && event.ctrlKey) {
|
||||
handleCollapseSidePanel();
|
||||
// If ^N then Create a new conversation
|
||||
} else if (event.key === "n" && event.ctrlKey) {
|
||||
createNewConversation();
|
||||
// If ^D then Delete the conversation history
|
||||
} else if (event.key === "d" && event.ctrlKey) {
|
||||
clearConversationHistory();
|
||||
}
|
||||
});
|
||||
let chatOptions = [];
|
||||
function createCopyParentText(message) {
|
||||
return function(event) {
|
||||
|
|
Loading…
Reference in a new issue