Package libavg :: Module textarea :: Class FocusContext

Class FocusContext

source code

This object serves as a grouping element for TextAreas. TextArea elements that belong to the same FocusContext cycle focus among themselves. There can be several FocusContextes but only one at once can be activated ( using the global function setActiveFocusContext() )

Instance Methods
 
__init__(self) source code
 
backspace(self)
Emulates a backspace character
source code
 
clear(self)
Clears the active textarea, emulating the press of FF character
source code
 
cycleFocus(self, backwards=False)
Force a focus cycle among instantiated textareas
source code
 
getFocused(self)
Returns a TextArea element that currently has focus within this FocusContext
source code
 
getRegistered(self)
Returns a list of TextArea currently registered within this FocusContext
source code
 
isActive(self)
Test if this FocusContext is active
source code
 
keyCharPressed(self, kchar)
Use this method to inject a character to active (w/ focus) TextArea, convenience method for keyUCodePressed()
source code
 
keyUCodePressed(self, keycode)
Shift a character (Unicode) into the active (w/focus) TextArea
source code
 
register(self, taElement)
Register a floating textarea with this FocusContext
source code
 
resetFocuses(self)
Blurs every TextArea registered within this FocusContext
source code
Method Details

keyCharPressed(self, kchar)

source code 
Use this method to inject a character to active (w/ focus) TextArea, convenience method for keyUCodePressed()
Parameters:
  • kchar - string, a single character

keyUCodePressed(self, keycode)

source code 
Shift a character (Unicode) into the active (w/focus) TextArea
Parameters:
  • keycode - int, unicode code point of the character

register(self, taElement)

source code 
Register a floating textarea with this FocusContext
Parameters:
  • taElement - TextArea, a reference to a TextArea