This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.awt.Toolkit | |
| import java.awt.datatransfer.StringSelection | |
| fun copyToClipboard(text: String) { | |
| val clipboard = Toolkit.getDefaultToolkit().systemClipboard | |
| val stringSelection = StringSelection(text) | |
| clipboard.setContents(stringSelection, null) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fun Modifier.moveFocusOnTab() = composed { | |
| val focusManager = LocalFocusManager.current | |
| onPreviewKeyEvent { | |
| if (it.type == KeyEventType.KeyDown && it.key == Key.Tab) { | |
| focusManager.moveFocus( | |
| if (it.isShiftPressed) FocusDirection.Previous else FocusDirection.Next | |
| ) | |
| true | |
| } else { | |
| false |