# Drag and drop

Drag-and-drop is a common way of moving files around in Windows. In Opus, drag-and-drop is controlled by the [**File Types**](https://chaoses-ib.gitbook.io/directory-opus/manual/file_types) system.

### Default drag-and-drop behavior

The default behavior is the same as in Explorer:

* Drag-and-drop of a file to another folder on the same drive will move it
* Drag-and-drop to a folder on a different drive will copy it
* Holding the Shift key when dropping forces the file to be moved
* Holding the Ctrl key when dropping forces it to be copied
* Holding the Alt key when dropping creates a shortcut to the file
* Drag-and-drop with the right button displays a menu that lets you select *Copy*, *Move* or *Create Shortcut* as the action.

Internally, these actions are defined by the items on the **Events** tab for the **All files and folders** file type. Whereas in Explorer these actions are fixed, in Opus they are configurable.

### Configuring drag-and-drop actions

![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-959cc624505c8c30df74c4c8c767fbdefde47a6c%2Fdefault_draganddrop.png?alt=media)

This screenshot shows the [File Type editor](https://chaoses-ib.gitbook.io/directory-opus/manual/file_types/filetype_editor) for the **All files and folders** file type. The events are all defined as some variant of the internal [**Copy**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/command_reference/internal_commands/copy) command.

* Drag-and-drop: `Copy MOVEWHENSAME` moves the file on the same drive, and copies it otherwise.
* Drag-and-drop+Alt: `Copy MAKESHORTCUT` makes a shortcut to the file.
* Drag-and-drop+Ctrl: `Copy RENAMEWHENSAME` automatically renames the copied file if the name clashes with an existing one.
* Drag-and-drop+Shift: `Copy MOVE` always moves the file.

Although not shown here, the **Drop Menu** tab also defines the contents of the menu shown when dragging with the right mouse button. This can also be configured.

Editing these functions modifies the drag-and-drop behaviour in Opus. For example, if you wanted drag-and-drop to always copy (rather than moving on the same drive), you could edit the command definition to `Copy RENAMEWHENSAME` (the same as the *Drag-and-drop+*&#x43;trl event).

### Overriding behaviour for specific file types

The **All files and folders** file type is a special file type that by definition matches everything - both files and folders. You can use the File Types system to define overriding events for specific file types. For example, you could configure drag-and-drop of a Zip file to extract the contents of the archive when dropped with the Shift key held down.

See the documentation on the [**File Types**](https://chaoses-ib.gitbook.io/directory-opus/manual/file_types) system for more information.
