PDA

View Full Version : A Qwerty Keyboard in AS3



Alber Kidd
March 7th, 2008, 05:46 AM
Has someone done one in AS3? Need the backspace too if possible.
Thanks

trilec
March 7th, 2008, 08:58 AM
Has someone done one in AS3? Need the backspace too if possible.
Thanks
not sure what your after?

perhaps this snip will help


public function keyDownHandler(event:KeyboardEvent):void {

switch (event.keyCode) {
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
doPageUpKey(event.keyCode, event.shiftKey && _allowMultipleSelection);
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
doRightKey(event.keyCode, event.shiftKey && _allowMultipleSelection);
break;
case Keyboard.SPACE:
doKeySelection( event.shiftKey, event.ctrlKey);
break;
default:
var nextIndex:int = getNextIndexAtLetter(String.fromCharCode(event.key Code), selectedIndex);
if (nextIndex > -1) {
selectedIndex = nextIndex;
}
break;
}
event.stopPropagation();

}