get the hexadecimal value of the char insert in a edit control

S

SanCaziano

how can I get get the hexadecimal value of the char insert in a edit control
(every time I press a key I want an alert message of its hexadecimal value)
 
G

g4toloc0

how can I get get the hexadecimal value of the char insert in a edit control
(every time I press a key I want an alert message of its hexadecimal value)

mmmm.. if you are talking about unicode key value, you can use:

onkeydown="alert(event.keyCode)"

this will give you a decimal unicode number representing the character
(just take a look at an ascii table to obtain all codes..)

As far as i know it does not make any distinction about lower and up
case (a and A returns 65)
event.shiftKey will tell you if shift key is pressed.

Converting to an hex value is up to you (google is you friend)

Ciao.
Seba
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top