param text returns export function copySelected ( text ) { if ( ( window as any ) . clipboardData ?. setData ) { ( window as any ) . clipboardData . setData ( 'Text' , text ) ; return true ; } if ( document . queryCommandSupported && document . queryCommandSupported ( 'copy' ) ) { const textarea = document . createElement ( 'textarea' ) ; textarea . textContent = text ; textarea . style . position = 'fixed' ; document . body . appendChild ( textarea ) ; textarea . select ( ) ; try { document . execCommand ( 'copy' ) ; return true ; } catch ( ex ) { return false ; } finally { document . body . removeChild ( textarea ) ; } } return false ; } export function copyShortcut ( e ) { if ( e . ctrlKey && e . shiftKey && e . keyCode === 67 ) { e . preventDefault ( ) ; document . execCommand ( 'copy' ) ; return false ; } return true ; }