little square in TextINput on multi key press

If a textinput has focus and i press ctrl+p i get little square in the text input
any way of stopping this , i presume flash is trying to interrupt the key press and cause it cant figure it out it puts in a generic symbol
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jockmahon01Author Commented:
I think flash is trying to find the character that belongs to the key combination ctrl-p. According to this ascii table the ascii description of ctrl-p is a DATA LINK ESCAPE. Flash problably does'nt know what kind of character this is, and just puts an unknown character.

Is there a reasin why you want to use crtl-p on a focused textfield. (like printing stuff?)

ascii table:

jockmahon01Author Commented:
well no, i have a number of textinputs and then a button, at any stage i want the user to be able to press a key combination , such as ctrl+p or something else, and it will do the same as pressing the button. So for example say  the button was add, I would have the "A"  underlined so the user could press ctrl+a and it would be the same as pressing the button.

Try something like this, run a function in an ontenterframe loop. There you check if a key that was pressed is a ctrl, or shift and then kill the focus on the focussed textfield. I have attached a snippet of actionscript code. Hope this works for you.


// get keypress in onenterframe loop
this.onEnterFrame = function() {
function DetectKeys() {
	if (Key.isDown(Key.CONTROL)) {
		// remove focus on textfield
	} else if (Key.isDown(Key.SHIFT)) {
		// remove focus on textfield

Open in new window

jockmahon01Author Commented:
one solution  that i have found for this is the following

nameSearchInput.restrict = "\u0020-\u007E £";

its setting the character range in hex, plus the £ char as it seams to get left out
this works a treat

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.