love
love copied to clipboard
love.window.isDropping
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).
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.
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.
Callbacks are added in 8d37303.
The desired functionality here actually isn't possible yet, until SDL adds it: https://github.com/libsdl-org/SDL/issues/5292
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