开发者

KEY_UP event of ctrl key blocks KEY_UP event of 'c' key

开发者 https://www.devze.com 2023-01-12 21:28 出处:网络
I am trying to capture Ctrl+C. I have noticed that many times, th开发者_如何学Pythonere is no KEY_UP event for C key. I believe it happens in cases KEY_UP event for C key should be thrown just befor

I am trying to capture Ctrl+C.

I have noticed that many times, th开发者_如何学Pythonere is no KEY_UP event for C key. I believe it happens in cases KEY_UP event for C key should be thrown just before or after KEY_UP event for Ctrlkey.

Why does this happen? How can I catch the KEY_UP for C key?


Everything works fine:

    <?xml version="1.0" encoding="utf-8"?>
< s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx">

<fx:Script>
    <![CDATA[
        protected function myButton_keyUpHandler(event:KeyboardEvent):void
        {
            myButton.label="";
            if(event.ctrlKey)
                myButton.label+="Ctrl-";
            if(event.altKey)
                myButton.label+="Alt-";
            myButton.label+=String.fromCharCode(event.keyCode)
        }
    ]]>
</fx:Script>



<s:Button id="myButton" keyUp="myButton_keyUpHandler(event)" />


</s:Application>
0

精彩评论

暂无评论...
验证码 换一张
取 消