diff --git a/js/copy_paste.js b/js/copy_paste.js index d6c1c269..79ba1366 100644 --- a/js/copy_paste.js +++ b/js/copy_paste.js @@ -16,7 +16,7 @@ const Clipbench = { let p = Prop.active_panel; let text; if (!check) { - text = window.getSelection()+''; + text = getFocusedTextInput() && window.getSelection()+''; } if (text) { return Clipbench.types.text; @@ -30,7 +30,7 @@ const Clipbench = { if (display_mode) { return Clipbench.types.display_slot } - if (Animator.open && Timeline.animators.length && (Timeline.selected.length || mode === 2) && ['keyframe', 'timeline'].includes(p)) { + if (Animator.open && Timeline.animators.length && (Timeline.selected.length || mode === 2) && ['keyframe', 'timeline', 'preview'].includes(p)) { return Clipbench.types.keyframe } if ((p == 'uv' || p == 'preview') && Modes.edit) { diff --git a/js/interface/keyboard.js b/js/interface/keyboard.js index 973026f5..959a7646 100644 --- a/js/interface/keyboard.js +++ b/js/interface/keyboard.js @@ -347,6 +347,10 @@ setInterval(() => { } }, 100) +function getFocusedTextInput() { + return $('input[type="text"]:focus, input[type="number"]:focus, *[contenteditable="true"]:focus, textarea:focus').get(0) +} + $(document).on('keydown mousedown', function(e) { if (Keybinds.recording || e.which < 4) return; //Shift @@ -358,7 +362,7 @@ $(document).on('keydown mousedown', function(e) { } var used = false; - var input_focus = $('input[type="text"]:focus, input[type="number"]:focus, *[contenteditable="true"]:focus, textarea:focus').get(0) + var input_focus = getFocusedTextInput() if (input_focus) { //User Editing Anything