Bug 79234 - [consistency] Tree does not fire Selection on Space
Summary: [consistency] Tree does not fire Selection on Space
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: consistency, triaged
Depends on:
Blocks:
 
Reported: 2004-11-22 14:54 EST by Grant Gayed CLA
Modified: 2020-02-04 07:41 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2004-11-22 14:54:59 EST
- run the ControlExample, go to the Tree tab
- listen for KeyUp, KeyDown, Selection and Default Selection
- give focus to an item in the example Tree on the page
- press Space
  -> on mac you'll get KeyDown - KeyUp
  -> on win32 and motif you'll get KeyDown, Selection, KeyUp
Comment 1 Steve Northover CLA 2004-11-22 19:10:58 EST
I believe this is platform behavior.  Need to check this.
Comment 2 Christophe Cornu CLA 2004-11-24 11:23:39 EST
-> on win32 and motif you'll get KeyDown, Selection, KeyUp
on XP (with and without manifest) I observe:
selection, key down, key up

1. on the Mac, pressing space bar on a currently selected item does not seem to trigger a notification.
kEventRawKeyDown
Display.textInputProc
KeyDown
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1082)
	at PR79234$1.handleEvent(PR79234.java:28)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1231)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1255)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1240)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1292)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1287)
	at org.eclipse.swt.widgets.Control.kEventTextInputUnicodeForKeyEvent(Control.java:1456)
	at org.eclipse.swt.widgets.Composite.kEventTextInputUnicodeForKeyEvent(Composite.java:484)
	at org.eclipse.swt.widgets.Tree.kEventTextInputUnicodeForKeyEvent(Tree.java:912)
	at org.eclipse.swt.widgets.Widget.textInputProc(Widget.java:1686)
	at org.eclipse.swt.widgets.Display.textInputProc(Display.java:3343)
	at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2536)
	at PR79234.main(PR79234.java:42)
kEventRawkeyup
KeyUp
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1082)
	at PR79234$1.handleEvent(PR79234.java:28)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1231)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1255)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1240)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1292)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1287)
	at org.eclipse.swt.widgets.Widget.kEventRawKeyUp(Widget.java:979)
	at org.eclipse.swt.widgets.Widget.keyboardProc(Widget.java:1041)
	at org.eclipse.swt.widgets.Display.keyboardProc(Display.java:2032)
	at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2536)
	at PR79234.main(PR79234.java:42)

2. On the other hand, SWT always fires a selection event when a mouse down is received:
Selection. 
Event created from:
	at org.eclipse.swt.widgets.Event.<init>(Event.java:187)
	at org.eclipse.swt.widgets.Tree.itemNotificationProc(Tree.java:817)
	at org.eclipse.swt.widgets.Display.itemNotificationProc(Display.java:2019)
	at org.eclipse.swt.internal.carbon.OS.CallNextEventHandler(Native Method)
	at org.eclipse.swt.widgets.Tree.kEventMouseDown(Tree.java:942)
	at org.eclipse.swt.widgets.Widget.mouseProc(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.mouseProc(Display.java:2476)
	at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2536)
	at PR79234.main(PR79234.java:42)

3. The Selection event upon keyboard 'selection' is sent from the stack trace below. However, the OS 
only fires it the first time it enters an item. As a result, we don't send the event for every space key even 
though we send selection for every mouse down.
Selection. 

	at org.eclipse.swt.widgets.Event.<init>(Event.java:187)
	at org.eclipse.swt.widgets.Tree.itemNotificationProc(Tree.java:817)
	at org.eclipse.swt.widgets.Display.itemNotificationProc(Display.java:2019)
	at org.eclipse.swt.internal.carbon.OS.CallNextEventHandler(Native Method)
	at org.eclipse.swt.widgets.Tree.kEventMouseDown(Tree.java:942)
	at org.eclipse.swt.widgets.Widget.mouseProc(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.mouseProc(Display.java:2476)
	at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2536)
	at PR79234.main(PR79234.java:42)
Comment 3 Christophe Cornu CLA 2004-11-24 11:34:43 EST
Behaviour seems to be the result of Mac DataBrowserCallbacks.u.v1.itemNotificationCallback.
Comment 4 Grant Gayed CLA 2004-11-30 09:29:01 EST
Similar to bug 79229, not firing Selection on Space may be a valid platform 
difference.
Comment 5 Steve Northover CLA 2005-01-19 19:53:41 EST
Grant to prioritize.
Comment 6 Grant Gayed CLA 2009-08-26 12:58:14 EDT
Moving report to triage, see http://www.eclipse.org/swt/triage.php
for more info about bug handling.
Comment 7 Silenio Quarti CLA 2012-06-22 15:30:37 EDT
Same behaviour in cocoa.
Comment 8 Lakshmi P Shanmugam CLA 2017-07-03 07:46:38 EDT
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more
information.
Comment 9 Eclipse Genie CLA 2020-02-04 07:41:18 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.