Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Capturing All Key Events in a Text Field
Capturing All Key Events in a Text Field [message #429992] Thu, 30 July 2009 15:24
MacSriver  is currently offline MacSriver Friend
Messages: 2
Registered: July 2009
Junior Member
I am working on a text field just like the "Binding" field in the "Keys" preferences page in Eclipse. In this text field, I want to display the key combination the user just hit, e.g. "Ctrl+P", "Alt+Shift+6", etc.

My text field (instance of Text) resides in an ApplicationWindow. What I already have basically works, only I don't want other key listeners to interfere. Escpecially I want to capture

  • the tab key and display "Tab", "Shift+Tab", "Ctrl+Tab", etc. How do I temporarily disable control traversal when my text field has the focus?
  • Alt+F4. It looks like the ApplicationWindow always closes when I hit Alt+F4 (under Windows). In most cases I'm fine with that, but how do deactivate this behavior?
  • accelerators from bound actions. Let's say I have a "Close Window" action in the window's menu that is assigned the accelerator Ctrl+W---how can I tell SWT not to execute the action so I can display "Ctrl+W" in my text field?

I'm really desperate and can't figure this out ...


PS: This forum and this text editor here looks neat.

[Updated on: Thu, 30 July 2009 15:24]

Report message to a moderator

Previous Topic:SWT Excel
Next Topic:test
Goto Forum:

Current Time: Sun Jan 26 16:00:31 GMT 2020

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

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

Back to the top