键盘

      被人教程 2005-8-4 10:57
_root.onKeyDown = function() {
    trace(Key.getCode());
};
Key.addListener(_root);
_root.onEnterFrame = function() {
    if (Key.isDown(65)) {
        trace("你按下了65");
    }
};
KeyPress = new Object();
KeyPress.onKeyDown = function() {
    time1 = getTimer();
    myKey1 = Key.getCode();
    if (time1-time2<150 && myKey1 == myKey2) {
        trace("双击");
    }
};
KeyPress.onKeyUp = function() {
    time2 = getTimer();
    myKey2 = Key.getCode();
};
Key.addListener(KeyPress);
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}