DisableKeys prevents the default behavior of several hard, soft or keyboard keys.
Example - Surprise
var prev;
function OnStart()
{
app.DisableKeys( "VOLUME_DOWN,VOLUME_UP" );
lay = app.CreateLayout( "Linear", "FillX" );
lay.SetPadding( 0, .85 );
lay.Hide();
img = app.CreateImage( "/Sys/Img/Hello.png", -1, .3 );
lay.AddChild( img );
app.AddLayout( lay );
app.ShowPopup( "Press the volume keys!" );
app.SetOnKey( OnKey );
}
function OnKey(action, name, code, extra)
{
if( action != prev ) {
if( action == "Down" ) lay.Animate( "SlideFromBottom", null, 300 );
if( action == "Up" ) lay.Animate( "SlideToBottom" , null, 300 );
}
prev = action;
}