• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. The Keyboard > Keyboard Events and the Focus Control

2.2. Keyboard Events and the Focus Control

Keyboard focus is the property that determines the target for keys that the user types. Normally, the control that has focus, called the focus control, receives all keyboard events until focus is assigned to another control. When a control has focus, it often draws in a different manner to give the user a visual cue. For example, a text widget might show a flashing I-beam caret; a list widget might draw a dotted rectangle; and so forth.

On some platforms, focus follows the mouse as it moves around the desktop from control to control. Keys go to the control that is under the mouse. On other platforms, the user must explicitly click in (or otherwise select) a control to give it focus. This policy is governed by the window manager and is not something that SWT programs need to worry about. That is, unless you deliberately override the behavior in your application, it will follow whatever the default is for the platform.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint