Bug 74736 - Please provide some way to determine the state of keys in the Tracker event loop and provide notifications when they change
Summary: Please provide some way to determine the state of keys in the Tracker event l...
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 74609 94350
  Show dependency tree
 
Reported: 2004-09-22 18:44 EDT by Stefan Xenos CLA
Modified: 2019-09-06 16:08 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2004-09-22 18:44:40 EDT
When inside our modal event loop for drag and drop, we'd like to change the
effect of a drop when the user presses a modifier key (like ctrl, shift, etc.)

Our drag and drop event loop uses the SWT Tracker class. To make this happen, we
need two things:

1. Ability to get the current state of all modifier keys.
2. The ability to determine when the key state changes (even if the user isn't
moving the tracker, we need to know that the key state changed so that we can
change the drop cursor).
Comment 1 Stefan Xenos CLA 2004-09-22 18:50:55 EDT
Steve: this is one of the Tracker things we were discussing with Michael.
Comment 2 Steve Northover CLA 2004-09-23 10:14:09 EDT
I forget exactly what we were going to do about this.  SSQ to consult with SN 
and GG.
Comment 3 Silenio Quarti CLA 2004-09-23 17:52:07 EDT
Are interested only on modifier keys (SHIFT, CTRL, etc) or any key?
Comment 4 Stefan Xenos CLA 2004-09-23 19:42:56 EDT
To fix bug 74609, we only need modifier keys... but don't let me stop you from
solving it for any key. :-)
Comment 5 Silenio Quarti CLA 2004-09-29 19:09:22 EDT
Fixed > 20040929.

It is possible to add key listener to Tracker now.
Comment 6 Stefan Xenos CLA 2004-10-08 17:38:37 EDT
This is still only half-fixed. We now have access to the state changes, but not
the ability to query for the current state of modifier keys.

If the user presses and holds ctrl before starting the drag, we have no way of
knowing that control is being held down (since we don't have a tracker at the
time of the keydown event).

This is similar to bug 71538, however we only need to know the state of modifier
keys (control, shift, alt) to fix our bug.
Comment 7 Steve Northover CLA 2004-10-14 17:55:35 EDT
Can you query the initial key and mouse state from the event stateMask?  It 
should be set in mouse, key and selection events.
Comment 8 Stefan Xenos CLA 2004-10-15 16:22:08 EDT
That is a much better solution than the key listener on its own, but it will
only work once the first event is received from the tracker. This means that at
the very start of the drag loop (until the mouse moves 1 pixel), we will be
showing the wrong drop target.
Comment 9 Stefan Xenos CLA 2004-10-15 16:22:58 EDT
Steve: are you saying that the stateMask now contains valid information? If so,
I can proceed with bug 74609.
Comment 10 Steve Northover CLA 2004-10-15 18:20:10 EDT
Use the inital state from the event.  It is set in mouse and keyboard and menu 
selection events.  Hopefully, that is enough for you to determine the initial 
state when you launch the Tracker.  SSQ will advise while I am gone.
Comment 11 Stefan Xenos CLA 2004-10-15 21:54:43 EDT
That workaround may work, but we can't use it. Our drags are started
programatically. The SWT event that triggered the start of the drag (if any) may
be on the other side of an API boundary from the code that creates the Tracker.
Comment 12 Steve Northover CLA 2004-10-25 12:00:51 EDT
That's a problem because the key state may have changed between the time of 
the event and the time your API is called.  Are you stuck on this?
Comment 13 Stefan Xenos CLA 2004-11-06 02:48:13 EST
Yes, this is still blocking bug 74609.
Comment 14 Stefan Xenos CLA 2004-11-06 02:49:59 EST
I just tested... the stateMask for the Tracker's SWT.Move event is not being
filled in, either.
Comment 15 Eclipse Webmaster CLA 2019-09-06 16:08:55 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.