Keyboard Molecule
From oWiki
Contents |
Preference Dialog
Attributes
type
string ( r )
Type of this molecule, 'keyboard'.
pref.enableWhen
string ( r, w )
Specifies the event that activates this molecule. Default is 'load'.
pref.disableWhen
string ( r, w )
Specifies the event that deactivates this molecule. Default is 'none'.
pref.keys
string ( r, w )
Specifies the character keys this molecule responds to.
pref.isTriggerEvent
bool ( r, w )
Specifies whether to send an event or execute a script on key press.
pref.eventName
string ( r, w )
Specifies the custom event name that this molecule sends out when detecting the given key press.
pref.withData
string ( r, w )
Specifies the object, variable, or array molecule that is to be sent along with the event or passed to the JavaScript function as input parameter.
pref.isBroadcast
bool ( r, w )
Specifies whether the event is sent to all droplets in the current page or a few selected droplets in a group.
pref.targets
array ( r, w )
Specifies a list of droplets' names that the event is to be delivered on key press.
pref.scriptName
string ( r, w )
Specifies JavaScript function name that is to be executed on key press.
Methods
clone()
Return: a molecule
| Create a clone of this molecule. |
attach(droplet)
droplet: a droplet object (e.g. app.box.droplet)
| Attach this molecule to a droplet. |
detach()
| Remove this molecule from its droplet. |
deleteMod()
| Delete this molecule. |
serialize()
Return: string
| Serialize this molecule into its JSON representation. |

