Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Fw: [platform-swt-dev] Key listener and Global actions in Eclipse.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On February 23, 2004 01:20 pm, Randy Hudson wrote:
> I have several questions.  First of all, why is there still experimental
> API at this point?  Supposedly, M6 was the deadline for all breaking
> changes.  So I don't see how API which is available in M7 could be backed
> out.

The API that was in M7 was marked as experimental; it has never been committed
to.  We are certainly not breaking anything intentionally.  The API available
in 2.1.x is still around, and can be used.  We are trying to finalize the
API, but as it is new API, we feel that we have until the end of M8 to
finalize it.

To name just a few other APIs that are still in flux: new Core preferences
APIs, the new expression APIs from Dirk Baeumer, and the cheat sheets API.


> Second, related to the original post, I have a Tool which would like to
> receive ALT+RIGHT whenever the user is using "keyboard accessibility" to
> drag objects as an alternative to using the mouse.  ALT is a modifier
> which means "don't snap to grid, etc".  CTRL is also a modifier meaning
> "clone", SHIFT = "constrained" operation.  So, I need the ability to
> temporarily receive these keystrokes regardless of keybindings.

There are ways of getting around key bindings (in a rough order of
preference):
+ Define a context, and place your key binding in that context.
+ Register your own handler for the command that is bound to the key binding
you want (generally, only advised if you have a similar semantic)
+ Disable key bindings globally when certain windows or components have focus
(e.g., used by the CyclePartAction dialog to switch editors)
+ Disable key bindings for certain windows
+ Attach a listener to the component, and remove the handler for the command
that blocks your key bindings
+ Use the hack described on the newsgroup (eclipse.platform) in response to
this post

As our API is still in flux, we'd be happy to hear about limitations you feel
exist with this API.  Please open enhancement requests for limitation you
feel exist.


> I'm pretty sure Nick said that if the action bound to a keybinding is
> disabled (or bound to NULL), then the keybinding service would stop
> consuming that key.  But this is not the behavior we are seeing.  For

We check whether the command has a handler (i.e., action) associated with it.
If it doesn't, then we don't eat the key.  We eat all keys that: (1) have a
key binding currently in context; and (2) have a handler currently active.


> example, we also need to receive CTRL+SPACE, which has universal meaning
> of "toggle selection" of item with focus. But the keybinding for Content
> Assist is getting in the way. Why do native Trees and Tables receive
> CTRL+SPACE, but our Canvas does not?

Likely because a handler is registered for your part.  I'm just guessing, as
I'm not sure of the details of your set-up.

Note: accelerator scope is the old 2.1.x term for contexts.  They are very
similar, but contexts are a more generic implementation.



I hope I remembered everything, and I hope this helps.



Cheers,
Doug.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAO2MpLhh1LVU8SusRAgL6AJ9LrJgPsjKJFIJuxvtXL+wHDZHIgACgth4b
UwRZzAu3e2CcUuqzTCkRzX0=
=uGRr
-----END PGP SIGNATURE-----


Back to the top