Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:01 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
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 17:53 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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 06:56 Go to previous message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
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: Thu Aug 08 16:28:08 GMT 2024

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

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

Back to the top