473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

May 10 '06 #1
1 1278
Csaba Gabor wrote:
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)?
No. But you can check it afterwards.
Hint: this is a trick question.


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
May 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Keeper | last post by:
Hi all, I'm trying to send chars to the current console (currently having cursor focus) - /dev/tty0 - in my program by: my $st = 'K' my $ri = 'L' my $ng = 'J' open(TTY, ">/dev/tty0");...
3
by: Lachlan Hunt | last post by:
Hi, I've been looking up lots of documentation and trying to work out a cross-platform method of capturing a keyboard event and working out which key was pressed. From what I can find, there...
23
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard...
2
by: wesmanjunk | last post by:
does anyone know how to generate keyboard events in another application? like public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); can be used for mouse...
0
by: luc.saffre | last post by:
Hello, I thought that I should ask here for comments on a blog entry that I wrote some weeks ago. I am sure that other people have been thinking about this, but I didn't yet find them. The...
7
by: TC | last post by:
Hi, I have developed a font, which has ~30 new characters in the Unicode Private Area (starting from U+E000). Now, since these characters are not present in the standard keyboard, can you...
2
by: Justin | last post by:
So I have a keyboard hook that I have implemeted into my c# app. I need to not allow any hotkey actions to be performed when my app is opened. I can capture the key events and handle them if I want...
2
by: pesobol | last post by:
I am using a wedge barcode scanner to enter data in an access database, but for certain combinations of characters I want to parse the input in code and react accordingly. The keypress event on...
13
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.