Name
LzFocus — Handles keyboard focus.
Description
This service manages the keyboard focus. At any time, at most one view
has the keyboard focus. This is the view that receives key events
when a key is pressed.
See The Software Developer's Guide for a discussion of keyboard focus.
Details
Static Properties (5)
-
csel
-
static public var csel = null;
-
downDel
-
static public var downDel = { ... };
-
focuswithkey
-
static public var focuswithkey : Boolean = null;
This attribute is set to true when the focus has moved
because the user has hit the next or prev focus key (usually 'tab' and
'shift-tab'.) If the focus moves due to mouse-click the value is set to
false. If the focus moves through programmatic control, the value is
unchanged from its last value.
-
lastfocus
-
static public var lastfocus : LzView = null;
A reference to the last view that held the focus
-
upDel
-
static public var upDel = { ... };
Static Methods (7)
-
clearFocus()
-
static public function clearFocus();
Remove the focus from the currently focused view (if there is one).
An 'onblur' event is first sent to the view.
-
getFocus()
-
static public function getFocus() : LzView;
Get the currently focused view.
-
getNext()
-
static public function getNext(focusview : LzView) : LzView;
Returns the next focusable view.
-
getPrev()
-
static public function getPrev(focusview : LzView) : LzView;
Returns the previous focusable view.
-
next()
-
static public function next();
Move the focus to the next focusable view.
-
prev()
-
static public function prev();
Move the focus to the previous focusable view.
-
setFocus()
-
static public function setFocus(newsel : LzView);
Set the focus to the given view. If this is not the currently
focused view, an onblur event is sent to the currently focused view,
and an onfocus event is sent to the new view. When setFocus is called as the
result of an onblur or onfocus event, all the delegates registered for the
event run before the next setFocus call is made. While it is not an error
for multiple responders to call setFocus as the result of the same onfocus
or onblur event, only one of the calls will be executed.
Static Events (1)
-
onfocus
-
static public event onfocus;
Sent when the focus changes, with the argument being the view
that was just focused. If nothing is focussed, this event is sent with null.
JavaScript Synopsis
public var LzFocus = { ... };