javascript to actionscript keypress passing utility?

后端 未结 4 1366
你的背包
你的背包 2020-12-16 07:25

Is there an existing javascript library for relaying key press events in the browser (or certain divs) into flash? I am hoping there might be a library kind of like this on

4条回答
  •  清酒与你
    2020-12-16 07:56

    Replaced ctrl with alt/option key, but it doesn't handle option down on mac:

    this works: //WORKS ONLY IN BROWSER: //tested on SAFARI 4.0 Mac and Firefox 3.5 Mac

    function onKey_Up(e:KeyboardEvent):void {
        tf2.appendText("\n"+e.keyCode)
    
        //alt+C
        if(e.keyCode==231){
            tf2.appendText("\nALT + C")
        }
        //alt+V
        if(e.keyCode==175){
            tf2.appendText("\nALT + V")
        }
        //alt+X
        if(e.keyCode==188){
            tf2.appendText("\nALT + X")
        }
    }
    

提交回复
热议问题