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 (8)
-
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
-
__LZsfnextfocus
-
static private var __LZsfnextfocus;
-
__LZsfrunning
-
static private var __LZsfrunning = false;
-
__LZskipblur
-
static private var __LZskipblur = false;
-
upDel
-
static public var upDel = { ... };
Static Methods (15)
-
accumulateSubviews()
-
static private function accumulateSubviews(accum, v, include, top);
Append those of v and its descendants that are focusable, to accum.
Always include 'include', and include focus traps but don't descend
into them unless this is the outermost call (and top=true).
-
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.
-
genMoveSelection()
-
static private function genMoveSelection(movedir);
-
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.
-
gotKeyDown()
-
static private function gotKeyDown(kC);
-
gotKeyUp()
-
static private function gotKeyUp(kC);
-
__LZcheckFocusChange()
-
static private function __LZcheckFocusChange(v);
-
moveSelSubview()
-
static private function moveSelSubview(v, mvdir);
Return an item in the same focus group as v, either preceding it (mvdir==-1)
or following it (mvdir==1) in preorder.
-
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.
-
setNextKey()
-
static private function setNextKey(k);
-
setPrevKey()
-
static private function setPrevKey(k);
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 = { ... };