PhantomJS event属性
它返回一个长列表的事件,如修饰符(modifier)、按键详情(keys details)等。
语法
其语法如下所示 −
var wpage = require('webpage').create();
wpage.event;
示例
让我们举个示例来理解 事件 属性的工作原理。
var page = require('webpage').create();
console.log(JSON.stringify(page.event));
以上程序产生以下 输出 。
{"modifier":{"shift":33554432,"ctrl":67108864,"alt":134217728,"meta":268435456, "
keypad":536870912},"key":{"0":48,"1":49,"2":50,"3":51,"4":52,"5":53,"6":54,"7":
5
5,"8":56,"9":57,"A":65,"AE":198,"Aacute":193,"Acircumflex":194,"AddFavorite":16
7
77408,"Adiaeresis":196,"Agrave":192,"Alt":16777251,"AltGr":16781571,"Ampersand" :
38,"Any":32,"Apostrophe":39,"ApplicationLeft":16777415,"ApplicationRight":16777
4
16,"Aring":197,"AsciiCircum":94,"AsciiTilde":126,"Asterisk":42,"At":64,"Atilde" :
195,"AudioCycleTrack":16777478,"AudioForward":16777474,"AudioRandomPlay":167774
7
6,"AudioRepeat":16777475,"AudioRewind":16777413,"Away":16777464,"B":66,"Back":1
6
777313}}