MidiOverlay Drag but not Drop
-
Does anyone know if there's a way to script a MidiOverlay so it won't allow dropping of .mid files, whilst still allowing dragging .mid from it
Thanks!
-
I've tried this but totally guessing
{ "ProcessorId": "MIDI_HK3", "Index": 0, "FollowWorkspace": false, "AllowDropping": false }
maybe someone knows the words to use here. Or I was thinking I could add a mouseCallback to a LAF and add some kind of if statement to check if the mouse is holding a file but I wouldn't know how to a achieve that kind of check
-
Solved. Bit of a workaround but simpler than I expected
const var pnl_DETECT = Content.getComponent("pnl_DETECT"); const var tile_DRAGROP = Content.getComponent("tile_DRAGROP"); const var pnl_BLOCK = Content.getComponent("pnl_BLOCK"); pnl_DETECT.setMouseCallback(function(event) { var w = this.getWidth(); var h = this.getHeight(); var isMouseOver = (event.x >= 0 && event.x <= w && event.y >= 0 && event.y <= h); var isDragging = event.drag || event.mouseDown || (event.x != this.data.lastX || event.y != this.data.lastY); this.data.lastX = event.x; this.data.lastY = event.y; if (isMouseOver && isDragging) { pnl_BLOCK.showControl(false); } else { pnl_BLOCK.showControl(true); } });