Keyboard shortcuts without conflicts (hopefully)

This commit is contained in:
oobabooga 2023-09-14 02:33:06 -07:00
parent fc11d1eff0
commit 6b6af74e14
3 changed files with 8 additions and 8 deletions

View File

@ -475,7 +475,7 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
left: 0; left: 0;
background-color: var(--background-fill-secondary); background-color: var(--background-fill-secondary);
z-index: 10000; z-index: 10000;
min-width: 300px; min-width: 330px;
flex-direction: column; flex-direction: column;
} }

View File

@ -63,14 +63,14 @@ document.addEventListener("keydown", function(event) {
document.getElementById('Regenerate').click(); document.getElementById('Regenerate').click();
} }
// Continue on Ctrl + Right // Continue on Ctrl + Shift + C
else if (event.ctrlKey && event.key === 'ArrowRight') { else if (event.ctrlKey && event.shiftKey && event.key === 'C') {
event.preventDefault(); event.preventDefault();
document.getElementById('Continue').click(); document.getElementById('Continue').click();
} }
// Remove last on Ctrl + Up // Remove last on Ctrl + Shift + Backspace
else if (event.ctrlKey && event.key === 'ArrowUp') { else if (event.ctrlKey && event.shiftKey && event.key === 'Backspace') {
event.preventDefault(); event.preventDefault();
document.getElementById('Remove-last').click(); document.getElementById('Remove-last').click();
} }
@ -87,7 +87,7 @@ document.addEventListener("keydown", function(event) {
document.getElementById('Replace-last').click(); document.getElementById('Replace-last').click();
} }
// Impersonate last on Ctrl + Shift + M // Impersonate on Ctrl + Shift + M
else if (event.ctrlKey && event.shiftKey && event.key === 'M') { else if (event.ctrlKey && event.shiftKey && event.key === 'M') {
event.preventDefault(); event.preventDefault();
document.getElementById('Impersonate').click(); document.getElementById('Impersonate').click();

View File

@ -39,8 +39,8 @@ def create_ui():
# Hover menu buttons # Hover menu buttons
shared.gradio['Regenerate'] = gr.Button('Regenerate (Ctrl + Enter)', elem_id='Regenerate') shared.gradio['Regenerate'] = gr.Button('Regenerate (Ctrl + Enter)', elem_id='Regenerate')
shared.gradio['Continue'] = gr.Button('Continue (Ctrl + Right)', elem_id='Continue') shared.gradio['Continue'] = gr.Button('Continue (Ctrl + Shift + C)', elem_id='Continue')
shared.gradio['Remove last'] = gr.Button('Remove last reply (Ctrl + Up)', elem_id='Remove-last') shared.gradio['Remove last'] = gr.Button('Remove last reply (Ctrl + Shift + Backspace)', elem_id='Remove-last')
shared.gradio['Replace last reply'] = gr.Button('Replace last reply (Ctrl + Shift + L)', elem_id='Replace-last') shared.gradio['Replace last reply'] = gr.Button('Replace last reply (Ctrl + Shift + L)', elem_id='Replace-last')
shared.gradio['Copy last reply'] = gr.Button('Copy last reply (Ctrl + Shift + K)', elem_id='Copy-last') shared.gradio['Copy last reply'] = gr.Button('Copy last reply (Ctrl + Shift + K)', elem_id='Copy-last')
shared.gradio['Impersonate'] = gr.Button('Impersonate (Ctrl + Shift + M)', elem_id='Impersonate') shared.gradio['Impersonate'] = gr.Button('Impersonate (Ctrl + Shift + M)', elem_id='Impersonate')