DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


Privacy Policy


Version1.42 is out since December 2nd 2016

Frequently Asked Questions


Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax


This is an old revision of the document!

Extra keys

This code snippet offers an extra line of keys to make some extra keys easier to get at.

It uses new features added in v1.09 beta, so will not work on release version 1.05

var gEdt;
//Called when application is started.
function OnStart(){
    //Create a layout with objects vertically centered.
    lay = app.CreateLayout( "linear", "Vcenter,FillXY" );    
    //Create a text edit and add it to layout.
    edt = app.CreateTextEdit( "Hello" );
    edt.SetTextSize( 32 );
    lay.AddChild( edt );
    //Create a checkbox for overstrike mode
    chkOvertype = app.CreateCheckBox("Overtype");
    //create a horizontal layout for special characters
    lay_keys = app.CreateLayout("linear","Horizontal,FillY");
    btns = []
    var ks = '{}[]();#"' + "'"
    for(i=0; i<ks.length; i++){
      var ch = ks.charAt(i);
      btn = app.CreateButton(ch);
    //Add layout to app.    
    app.AddLayout( lay );
    gEdt = edt;
function btn_OnTouch(){
    var s = this.GetText();
    var pos = gEdt.GetCursorPos();
    var theEnd = gEdt.GetText().length;
    if(! chkOvertype.GetChecked()){
      gEdt.InsertText(s, pos);
    } else{
      gEdt.ReplaceText(s, pos, Math.min(pos+s.length, theEnd));
      gEdt.SetCursorPos(pos + s.length);
sample_code/extra_keys.1411294781.txt.gz · Last modified: 2014/09/21 10:19 by