Capture Keyboard Event in Actionscript3.0



function reportKeyDown(event:KeyboardEvent):void 
{ 
	trace(
		"Key Pressed: " + 
		String.fromCharCode(event.charCode) + 
		" (character code: " + event.charCode + ")"
	   ); 

} 



Key Pressed: a (character code: 97)

Key Pressed: b (character code: 98)
Key Pressed: c (character code: 99)
Key Pressed: d (character code: 100)
Key Pressed: e (character code: 101)
Key Pressed: f (character code: 102)
Key Pressed: g (character code: 103)
Key Pressed: h (character code: 104)
Key Pressed: i (character code: 105)
Key Pressed: j (character code: 106)
Key Pressed: k (character code: 107)
Key Pressed: l (character code: 108)
Key Pressed: m (character code: 109)
Key Pressed: n (character code: 110)
Key Pressed: o (character code: 111)
Key Pressed: p (character code: 112)
Key Pressed: q (character code: 113)
Key Pressed: r (character code: 114)
Key Pressed: s (character code: 115)
Key Pressed: t (character code: 116)
Key Pressed: u (character code: 117)
Key Pressed: v (character code: 118)
Key Pressed: w (character code: 119)
Key Pressed: x (character code: 120)
Key Pressed: y (character code: 121)

Key Pressed: z (character code: 122)




评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值