@@ -19,14 +19,14 @@ function TrackpadPage() {
1919 const bufferText = buffer . join ( " + " ) ;
2020 const hiddenInputRef = useRef < HTMLInputElement > ( null ) ;
2121 const isComposingRef = useRef ( false ) ;
22-
22+
2323 // Load Client Settings
2424 const [ sensitivity ] = useState ( ( ) => {
2525 if ( typeof window === 'undefined' ) return 1.0 ;
2626 const s = localStorage . getItem ( 'rein_sensitivity' ) ;
2727 return s ? parseFloat ( s ) : 1.0 ;
2828 } ) ;
29-
29+
3030 const [ invertScroll ] = useState ( ( ) => {
3131 if ( typeof window === 'undefined' ) return false ;
3232 const s = localStorage . getItem ( 'rein_invert' ) ;
@@ -49,7 +49,7 @@ function TrackpadPage() {
4949
5050 const handleKeyDown = ( e : React . KeyboardEvent < HTMLInputElement > ) => {
5151 const key = e . key . toLowerCase ( ) ;
52-
52+
5353 if ( modifier !== "Release" ) {
5454 if ( key === 'backspace' ) {
5555 e . preventDefault ( ) ;
@@ -76,7 +76,7 @@ function TrackpadPage() {
7676 } ;
7777
7878 const handleModifierState = ( ) => {
79- switch ( modifier ) {
79+ switch ( modifier ) {
8080 case "Active" :
8181 if ( buffer . length > 0 ) {
8282 setModifier ( "Hold" ) ;
@@ -97,7 +97,7 @@ function TrackpadPage() {
9797
9898 const handleModifier = ( key : string ) => {
9999 console . log ( `handleModifier called with key: ${ key } , current modifier: ${ modifier } , buffer:` , buffer ) ;
100-
100+
101101 if ( modifier === "Hold" ) {
102102 const comboKeys = [ ...buffer , key ] ;
103103 console . log ( `Sending combo:` , comboKeys ) ;
@@ -139,7 +139,7 @@ function TrackpadPage() {
139139 // Don't send text during modifier mode
140140 if ( modifier !== "Release" ) {
141141 handleModifier ( val ) ;
142- } else {
142+ } else {
143143 sendText ( val ) ;
144144 }
145145 ( e . target as HTMLInputElement ) . value = '' ;
@@ -153,6 +153,9 @@ function TrackpadPage() {
153153 }
154154 } ;
155155
156+ const COPY_COMBO = [ "control" , "c" ] as const ;
157+ const PASTE_COMBO = [ "control" , "v" ] as const ;
158+
156159 return (
157160 < div
158161 className = "flex flex-col h-full overflow-hidden"
@@ -177,6 +180,8 @@ function TrackpadPage() {
177180 onRightClick = { ( ) => handleClick ( 'right' ) }
178181 onKeyboardToggle = { focusInput }
179182 onModifierToggle = { handleModifierState }
183+ onCopy = { ( ) => sendCombo ( [ ...COPY_COMBO ] ) }
184+ onPaste = { ( ) => sendCombo ( [ ...PASTE_COMBO ] ) }
180185 />
181186
182187 { /* Extra Keys */ }
0 commit comments