所有活动页面如何实施撤消和重做 有例子吗? 3如何在所有事件中使用Ctrl + Z和Ctrl + Y? ////////// 染色 文本 点击 画 抹去 //////////
由于
答案 0 :(得分:0)
Ctrl,Alt和Shift键实际上是KeyboardEvent的布尔值。
所以,像这样做一个普通的事件监听器:
addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
然后当您正常调用函数时,使用(e:KeyboardEvent)变量获取e.ctrlKey的布尔值(true =被按下,false =未被按下)。
if (e.ctrlKey)
{
// Check any keys that you want to use as CTRL commands here.
}
if (e.shiftKey)
{
// Check any keys that you want to use as SHIFT commands here.
}
if (e.altKey)
{
// Check any keys that you want to use as ALT commands here.
}