Community
Participate
Working Groups
I'm using swt-3.0RC1-win32 version of SWT library. Sample of my code: Display display = new Display (); Shell shell = new Shell (display); Button ok = new Button (shell, SWT.PUSH); ok.addSelectionListener(new SelectionAdapter(){ public void widgetSelected(SelectionEvent e) { System.out.println("StateMask:" + e.stateMask); } }); ok.setText ("Try"); shell.setLayout (new RowLayout ()); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); If push "Try" with pressed CTRL (SHIFT, ALT) stateMask field remains 0 (instead of expected SWT.CTRL, SWT.SHIFT, SWT.ALT).
This mask is only set for MenuItems during selection. We should consider filling it in for all controls or providing API in display to query the state. Post 3.0.
*** Bug 80822 has been marked as a duplicate of this bug. ***
It will be very useful to fill the stateMask for all controls. For exemple, for a TableColumn. It can be useful to select more than one column to sort a TableViewer when Ctrl is pressed...
*** Bug 82545 has been marked as a duplicate of this bug. ***
I realy need this fix for my applications. Do you have any clue on where to fix this bug ?
Laurent, we are probably not going to get to this for 3.1. In which control do you need this information?
(In reply to comment #6) > Laurent, we are probably not going to get to this for 3.1. In which control > do you need this information? I need this for the TableColumn. When I select one, I need to know what is the mask.
(In reply to comment #6) The same bug exists on OS X in 3.1. It would be very useful for us if we could have the state mask in TableColumns, exactly for the same purpose Laurant explained in comment #3. Our RCP applications uses tables heavily and the customers expects such a behavior to sort columns.
(In reply to comment #8) Bump. What is the status/workaround for this issue? I ran into the same thing when trying to implement multiple sort columns. Cheers.
It's a big job to go and find every selection event on every platform and fill in the values. Also, people who write their own controls would need to fill in the values themselves. Querying the key state on X systems can be expensive because it causes a round trip to the server.
Steve, Is SelectionEvent.stateMask only populated for "menu selection events"? If so, it would be helpful if that was mentioned in the SelectionEvent Javadoc somewhere (ideally the API would not expose dummy fields; e.g. remove stateMask from SelectionEvent and provide a MenuSelectionEvent). I see two workarounds for this issue (if it is undesirable to provide a stateMask for every SelectionEvent) * Enable TableColumn to receive MouseEvents (which do have a functional stateMask). Some work for this can be found in bug 32322 * Provide a way to query the key state. How reliable is OS.GetKeyState across platforms? (See also bug 74736 and bug 71538 ) Cheers.
Bump. Is there a chance to have the bug fixed for 3.2 ? At least for the TableColumn ? Please...
!@#$!@$$!@#$!@!! I missed this one. I'm sorry but it won't make it into 3.2. Ping early in the 3.3 cycle please.
Would like the stateMask updated in a TableColumn selection event too. Thank you.
up ! for the 3.3 please ;) Have you some news ?
No news... Good news ?
Hello again, Today it would have help me very much to be able to access the statemask in the locationevent of a browser... It is really something I would like to see in all the controls. Thank you the SWT team to think about this. Francis
Would also be interesting for ToolItems (e.g. Ctrl+Click on a tool bar button).
I have to say this feature is useful (if not critical) for lots of applications.. but still not in eclipse 3.3
Dup of bug 55500 (or vice versa)?
Fixed in HEAD > 20091023 fixed for win32, gtk, and cocoa all the following: Button -- button is activate CoolItem -- chevron is activate TreeColumn -- column is activate (click on header) TableColumn -- column is activate (click on header) Link -- a link is activate MenuItem -- item is activate ToolItem -- item is activate ToolTip -- item is activate (clicked on) TrayItem -- item is activate (clicked on) List -- selected item changes Table -- selected item changes Tree -- selected item changes TabFolder -- selected item changes Combo -- selected item in the list changes DateTime -- value of a field changes Sash -- sash location changes Scale -- selection value changes ScrollBar -- selection value changes Slider -- selection value changes Spinner -- selection value changes DefaultSelection All activate Text -- return on single, click on search icon DateTime -- return Table -- return or double click Tree -- return or double click List -- [return or] double click Combo -- return Spinner -- return TrayItem -- double click --------------------------------------------- I still need to take a look at the custom controls and motif and carbon.
*** Bug 55500 has been marked as a duplicate of this bug. ***