Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Keyboard Events
Keyboard Events [message #879865] Thu, 31 May 2012 22:14 Go to next message
Eclipse UserFriend
I've been having trouble obtaining keyboard focus for my SWT widgets, nothing seems to be able to setFocus() and all requests for the focus owner are returning null.

I've also tried using the keybinding commands in e4, which work occassionally, but keyboard focus seems to be grabbed by some mystery force within the swt frame when i click on it, and I can never get focus back for the keybindings to work again.


All that I really need is a solution that will pick up all keypress events for my application and print out that the keys have been pressed. Does anyone know a simple way of doing this in e4? Possibly a global keybinding context that I can use?


There are some intricacies of my UI that may make obtaining focus tricky for some of the more deeply nested components, but I'm unable to even request focus for my top level shell or display.

Any help would be greatly appreciated! Thanks!


~Christopher Riley
Re: Keyboard Events [message #880048 is a reply to message #879865] Fri, 01 June 2012 06:37 Go to previous messageGo to next message
Eclipse UserFriend
Use SWT Display filters.

Make sure you're providing a @Focus method that does more thn set the focus on the *provided* Composite -- you have to set the fous to a widget that *your* part created (though that can be a composite).
Re: Keyboard Events [message #880060 is a reply to message #879865] Fri, 01 June 2012 06:49 Go to previous message
Eclipse UserFriend
Also try to use forceFocus() if setFocus() doesn't work. This bug may be relevant
https://bugs.eclipse.org/bugs/show_bug.cgi?id=379024
Previous Topic:e4 compatibility: PerspectiveRegistry.clonePerspective
Next Topic:MDirtyable usage
Goto Forum:
  


Current Time: Wed Jul 23 02:09:40 EDT 2025

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

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

Back to the top