# Dragging a file from the app with GLFW

**URL:** <https://discourse.glfw.org/t/dragging-a-file-from-the-app-with-glfw/2056>\
**Category:** dev\
**Created:** [May 18, 2022, 5:08pm UTC](https://discourse.glfw.org/t/dragging-a-file-from-the-app-with-glfw/2056 "2022-05-18T17:08:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![UkkoPekka](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@UkkoPekka](https://discourse.glfw.org/u/UkkoPekka)\
**Post date:** [May 18, 2022, 5:08pm UTC](https://discourse.glfw.org/t/dragging-a-file-from-the-app-with-glfw/2056/1 "2022-05-18T17:08:01Z")

</div>

Hi!

I’m unfortunately very unexperienced as a programmer to be able to do this myself so I’m mentioning this idea here in case if anyone else is interested looking into this.

Basically, setting a drag and dropable file from the application. I know there are some programs that do this but I was not able to find much from this topic. Here’s the only thing I was able to find. Search for the title **Initiating a drag and drop**

[https://www.codeproject.com/Articles/840/How-to-Implement-Drag-and-Drop-Between-Your-Progra](https://www.codeproject.com/Articles/840/How-to-Implement-Drag-and-Drop-Between-Your-Progra)

Would love to see a function for this purpose in GLFW!

Cheers,  
UkkoPekka

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [May 21, 2022, 3:37pm UTC](https://discourse.glfw.org/t/dragging-a-file-from-the-app-with-glfw/2056/2 "2022-05-21T15:37:53Z")

</div>

Hi @UkkoPekka,

Welcome to the GLFW forum

There is already [basic drag and drop functionality available in GLFW](https://www.glfw.org/docs/latest/input_guide.html#path_drop) and an issue for [more advanced events](https://github.com/glfw/glfw/issues/1898).

Whilst the current API doesn’t expose being able to drag a file from one app to another, it would be possible to do something similar with [the clipboard API](https://www.glfw.org/docs/latest/input_guide.html#clipboard) by setting a string path with one app and retrieving that with the other. This would mean using CTRL+C, CTRL+V or similar rather than drag and drop but could work for your needs.

---

<div class="post-metadata">

**Author:** ![UkkoPekka](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@UkkoPekka](https://discourse.glfw.org/u/UkkoPekka)\
**Post date:** [May 21, 2022, 3:51pm UTC](https://discourse.glfw.org/t/dragging-a-file-from-the-app-with-glfw/2056/3 "2022-05-21T15:51:18Z")

</div>

Hi dougbinks!

Thanks! That clipboard method is definitely one way to go. I might go with that for now.

This was mostly a suggestion for anyone interested to look at in the future. Having the ability to drag a file from the application to other as a save method could be very intuitive for small tools that do not use save file dialogs.
