Drag and Drop external file into built app

Hello all,

Been here a week and having fun :slight_smile:

I am working on a project that needs to have a user drag & drop a file form their Desktop onto my app. The app doesn’t need the actual file, just to grab the “path” to the file (could be local, network drive, or intranet/internet). Eventually I would like to Open the link by touching the copied link (using whatever default program opens that file type)

Is this something that exists within the Solar2D framework or something that will involve C++ or other coding outside of Solar2D? I walked the forums but couldn’t find anything like it.

The app will initially be on Windows Desktop, but eventually will be ported to Mac as well (once I buy the Mac to start coding) :wink:

Thanks & cheers

I don’t think there’s anything of the sort in Solar2D.

I’m also not certain on how to approach this particular challenge. Perhaps via a native plugin?

Welcome! :slightly_smiling_face:

There are a few of us motivated to making Desktop applications with Solar2D, it doesn’t seem to be the norm but in my opinion it does appear to start picking up pace slowly.

Drag and drop from the OS to the application itself is one feature currently not available but it is desired. I know mouse events are not being tracked outside of the Solar2D window maybe because of the same restrictions.
Solar2D is new to the “community driven” model, and I have high hopes for this to be available eventually.

@Siu Thanks for the welcome :smile:
@XeduR I’ve been playing in your playground for a while again :wink:

I have nowhere near enough knowledge on this, but I’ll keep searching and see if I come up with any other options, perhaps other Lua based programs that may have a similar ability that we can consider.
Cheers

Hmm, I thought this was generally available, but I guess it must be Mac-only.

This would involve a Windows message, so for that reason and parity with Mac would probably best be added to the core.

LiveServer does seem to implement this message: see this, which resolves to the bit here.

I’m aware of two message pumps apart from that.

This one handles input done by your application itself.

I’m not actually sure what this case is about, unless it’s the simulator-specific bits?

I guess one could hunt around in the Mac implementation to suss out the plumbing details to tie this together with the "application*" events.

Hey @StarCrunch Thanks for the pointers & direction.

Having a look at source, I can see where the implementation may be. However C++ is about as understandable to me as Swahili! I’ll get on with a friend who is a C++ phreak and see what he thinks.

Cheers

That’s the only “sad” thing about Solar2D’s past, Windows Desktop seemed like a second class citizen. I’m still grateful we have it though. :slightly_smiling_face:

Interestingly enough the simulator does do drag and drop in Windows.

@Siu Thanks for the voice.

I wholeheartedly agree! It seems that Solar2D has SO much going for it. It uses a non-proprietary language/syntax (Lua) and has some pretty powerful 2D physics.

But, as to the Simulator doing drag & drop in Windows - I was never able to get anything working. Perhaps we can dig into the mechanics and figure out how to make it work.

Although the market may have proportionately moved to the mobile market, I don’t see lots of office workers doing their daily jobs on their smartphones :wink: That means there is still lots of gravy on the table.

Cheers