Generic Drag&Drop get ctrl, shift, alt and meta key
See original GitHub issueDescription of the feature
I am using the generic Drag&Drop and would like to be able to change the behavior based on the pressed key modifiers.
Example: In Windows, draging a file usually moves it, but if you press ctrl
, it will copy the file instead.
I would like to be able to do the same in Vaadin.
Note:
It seems to be enough to add @EventData("event.ctrlKey") boolean ctrlKey
and so on to the constructor of DragEvent
(and maybe also the other Drag&Drop related events) and store the result in a member.
For now, I created a custom DragEvent
which adds the given information.
Versions:
- Vaadin / Flow version: 19.0.6
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to get Ctrl, Shift or Alt with getch() ncurses?
First, for "normal keys" such as the printable ones, you can easily detect shift because it uppercases. For special keys, e.g. KEY_LEFT, you...
Read more >Reading keyboard ctrlKey (Alt, Shift) state from monitor #512
I would like to modify drop action behavior depending on ctrl button state. E.g. if Ctrl is pressed currently dragged item has to...
Read more >Control key acts as if it is stuck periodically - Super User
Press both ctrl + shift + alt at the same time including the Fn key (Lenovo). If it still does not work, opening...
Read more >Key other than Control to send SIG - Unix StackExchange
Modifiers get names and numbers; Control, CapsLock and Shift are always on the same number but the others (Alt, Meta, Hyper, Super, NumLock, ......
Read more >How do I swap Left Ctrl with Left Alt on my keyboard?
If you start pressing keys on your keyboard you'll get all the key ... Change the Ctrl position option to Swap Left Alt...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
See #7500
I just noticed, that a few things (like the
v-drag-over-target
class) are linked to theDropEffect
you set on theDropTarget
. So solving the related Issue #7500 will probably not be that easy. So I think it wouldn’t be a bad idea to add theKeyModifier
s (the related flags) to the dnd events, as it won’t hurt if they are not needed. It’s just an additional information you can use if you want.