Click or drag to resize

key Property

Gets a value representing the key value pressed.

Syntax
JavaScript
this.key;

Property Value

Type: String

The key pressed by the user.

Remarks

This property is read-only and should not be set to.

Examples
The following example uses the ObjectKeypressEventArgs Properties to handle the "objectKeypress" event of the PdfWebControlApi Class.
JavaScript
//declare event handler function (which accepts an object of type ObjectKeypressEventArgs as an argument)
function objectKeypressHandler(evt)
{
    //make the new object unmovable
    evt.obj.setProperties( {"movable" : false} );

    //if this is the letter A
    if(evt.key == "a")
    {
        //cancel the default keypress action
        evt.cancel = true;
    }
}

//get API class
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

//attach event handler to objectClick event
myApi.addEventListener("objectKeypress", objectKeypressHandler);
See Also