TheQwertiest / foo_spider_monkey_panel

foobar2000 component that allows to use JavaScript to create CUI/DUI panels
https://theqwertiest.github.io/foo_spider_monkey_panel/
MIT License
274 stars 21 forks source link

Link effect not working on drag drop #218

Open regorxxx opened 1 year ago

regorxxx commented 1 year ago
window.DefineScript('bug', {features: {drag_n_drop: true, grab_focus: true}});

function on_drag_drop(action, x, y, mask) {
    console.log('enter', action);
}

function on_drag_over(action, x, y, mask) {
    if ((mask & 32) === 32) {action.Effect = dropEffect.link;}
}

function on_drag_leave() {
    console.log('leave');
}

const dropEffect = {
    none:   0,
    copy:   1,
    move:   2,
    link:   4,
    scroll: 0x80000000
};

Console will always report on_drag_leave firing when pressing alt, instead of on_drag_drop. It works properly for all other effects. The drag n drop sample doesn't work too. Win 10.