Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
how can I get Ascii Code of Arabic key From KeyDown Event Winform

e.KeyValue is often give english Ascii Code
please I need your helps.
Posted

"ASCII Code Arabic" is oxymoron (see http://en.wikipedia.org/wiki/Oxymoron[^], sorry, I did not find Arabic version of this Wikipedia article :-)). ASCII is 7-bit code or 8-bit code with unused high bit (=0), so all code points integer values are below the value of 128. Arabic is supported as Unicode, all code points are in BMP (which need 16 bits), code point range from 0x0600 to 0x06FF, supplements from 0x0075 to 0x077F, presentation forms 0xFB50 to 0xFDFD — way more characters then ASCII could fit :-).

Please see http://www.unicode.org/charts/[^].

.NET Framework fully supports .NET, ASCII is not used. You can get the integer value representing the Unicode code point from as System.Windows.Forms.KeyEventArgs.KeyValue property passed to the event handlers of events like System.Windows.Forms.KeyDown/KeyUp.

Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.keyvalue.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.keydata.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx[^].

—SA
 
Share this answer
 
Comments
Christian Graus 27-Jun-11 20:18pm    
See, I thought that should be true, but just assumed he had some idea what he was talking about :P
Sergey Alexandrovich Kryukov 29-Jun-11 5:54am    
I would say that was overly brave assumption :-)
--SA
There is no such thing as an ASCII Arabic code. ASCII does not contain those chars, that's why you need to get the Unicode value. I assume that one of the other event args passed in gives you that ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900