Script 1.8.1

delete (对象成员函数)

原型:

<Keyboard Object>.delete()

描述:

删除当前 Keyboard 对象

参数:

返回值:

示例:
//函数带两个参数:第一个为 device ,第二个为 data ,函数 trytrytry 如下所示:
trytrytry=function(device, x) {
    if (x==1) {
        print("data is 1");
    } else {
        print("x.device: " + x.device);
        print("x.field1: " + x.field1);
        print("x.field2: " + x.field2);
        x.device.send(sigmaConst.KEY_HOME);
        }
	}

//新建 Keyboard 对象 key1,快捷键为 CA|U, 函数为 trytrytry,app为空,但是没指定 device
key1 = new Keyboard('CA|U', trytrytry, {app:null, data:1});
// 获取已创建的 Keyboard 对象 getkey1
getkey1 = Keyboard.searchObject('CA|U')
//删除当前 Keyboard 对象 getkey1
getkey1.delete();