love icon indicating copy to clipboard operation
love copied to clipboard

love.window.isDropping

Open slime73 opened this issue 7 years ago • 5 comments

Original report by hahawoo (Bitbucket: hahawoo, GitHub: hahawoo).


I think it would be nice if there was a function which returned whether the user is dragging a file/directory over the window but hasn't released the mouse button yet, so a "drop file here!" message could display or something.

Briefly looking at the SDL docs, I guess this would mean setting some internal value when SDL_DROPBEGIN and SDL_DROPFILE happen (if those events do what I assume they do).

slime73 avatar Aug 31 '17 15:08 slime73

Original comment by Gabe Stilez (Bitbucket: z0r8, ).


I'm kinda thinking this is OS-dependent; in windows, i'm not sure if the löve window can actually detect when the cursor is over it.

I might be wrong though; no idea how (or when) DROPBEGIN is detected.

slime73 avatar Sep 08 '17 00:09 slime73

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


Looking at the docs, it kind of suggests DROPBEGIN and DROPCOMPLETE are a grouping mechanism. So if two files are dropped, you'd get DROPBEGIN, DROPFILE, DROPFILE and DROPCOMPLETE.

slime73 avatar Mar 13 '18 18:03 slime73

Callbacks are added in 8d37303.

slime73 avatar Apr 16 '22 19:04 slime73

The desired functionality here actually isn't possible yet, until SDL adds it: https://github.com/libsdl-org/SDL/issues/5292

slime73 avatar Mar 04 '23 20:03 slime73

For love 11.4, I've created a basic library https://github.com/EngineerSmith/isdropping to get a similar behaviour - but isn't perfect with the issue of not having a SDL event for it. Adding this comment here if anyone needs a solution around this for now

EngineerSmith avatar Mar 05 '23 19:03 EngineerSmith