Connecting Tech Pros Worldwide Help | Site Map

keyboard events and characters

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 10th, 2006, 10:25 PM
Csaba Gabor
Guest
 
Posts: n/a
Default keyboard events and characters

Is there a way to definitively know what (and whether any) character is
about to be plunked into a textarea based on keyboard input (from
keydown, keypress, keyup, or other events)?

Hint: this is a trick question.

But you can assume that the textarea has focus, and the focus isn't
changed (no alt+tab type of situations),
and that this is not a question about the clipboard (so we're not
worrying about ctrl+v, delete, backspace, and friends),
and that the entire chain of events is delivered (unlike printScreen or
ctrl+tab and friends).

Furthermore, "plunked into" means that textarea.value will change
(assuming there is no selection). That is to say, I'm really not
concerned with whether the user will see the character well rendered or
whether it's a tab character or a newline or something the rendering
engine doesn't know about.

To be concrete with an example, ctrl+a => "", since it's not a printing
character, and shift+a => "A", and if my keyboard maps ctrl+alt+o to
ó, then ctrl+alt+o => "ó".

Csaba Gabor from Vienna


  #2  
Old May 19th, 2006, 12:25 PM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
Default Re: keyboard events and characters

Csaba Gabor wrote:
[color=blue]
> Is there a way to definitively know what (and whether any) character is
> about to be plunked into a textarea based on keyboard input (from
> keydown, keypress, keyup, or other events)?[/color]

No. But you can check it afterwards.
[color=blue]
> Hint: this is a trick question.[/color]

How boring.


PointedEars
--
Those who desire to give up freedom in order to gain security,
will not have, nor do they deserve, either one.
-- Benjamin Franklin
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.