Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to detect key state when clicking a table column
How to detect key state when clicking a table column [message #327072] Tue, 08 April 2008 11:01 Go to next message
Eclipse UserFriend
Hi,

I would like to react to the SWT.Selection event on click of a header of a
table column, depending on the state of the Control key.

But Event.stateMask is always 0.
I have tried to capture MouseDown on the table, but isn't called when
clicking on a header.

Any suggestion will be greatly welcome.
Re: How to detect key state when clicking a table column [message #327078 is a reply to message #327072] Tue, 08 April 2008 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

This is not currently supported. SWT.Selection events by convention don't
have their state mask set with this info, so you need to get a MouseDown,
which TableColumn does not send. The existing request for a table header
widget, which is what would surface this event, is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=93129 .

Grant


"David Perez" <craquerpro@yahoo.es> wrote in message
news:b6d2b04db5b17c12027fdb049f1e4610$1@www.eclipse.org...
> Hi,
>
> I would like to react to the SWT.Selection event on click of a header of a
> table column, depending on the state of the Control key.
>
> But Event.stateMask is always 0.
> I have tried to capture MouseDown on the table, but isn't called when
> clicking on a header.
>
> Any suggestion will be greatly welcome.
>
Re: How to detect key state when clicking a table column [message #327084 is a reply to message #327078] Wed, 09 April 2008 02:56 Go to previous message
Eclipse UserFriend
Thanks Grant,
your tip has been helpful. I'm surprise to see how such a long
outstanding request remains unsolved (from year 2005).

Here is my workaround (for Win32, the only platform I'm currently using):

if ((OS.GetKeyState(OS.VK_CONTROL) & 0xF0) == 0) {
....
}

In this way I can do specific processing when the control key is being
held down. Luckily most Win32 API's are accessible through SWT.

Grant Gayed wrote:

> Hi,

> This is not currently supported. SWT.Selection events by convention don't
> have their state mask set with this info, so you need to get a MouseDown,
> which TableColumn does not send. The existing request for a table header
> widget, which is what would surface this event, is
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=93129 .

> Grant
Previous Topic:Open Resource filePath in a Cheat Sheet
Next Topic:Viewing console output of exec right away
Goto Forum:
  


Current Time: Mon Apr 14 18:42:28 EDT 2025

Powered by FUDForum. Page generated in 0.02450 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top