|
-
Apr 2nd, 2004, 05:06 PM
#1
Thread Starter
Fanatic Member
Capture the hex code from keyboard input?
Hello,
How would I write a small app that would capture the hex input from a character entered on the keyboard. Basically, I am trying to figure out the ASCII hex code of another language. I have add the other language in control panel and am able to use the keyboard to type in that language, but I need to know the ASCII hex characters so that I can use them in another program.
Thanks!
-
Apr 3rd, 2004, 04:22 AM
#2
Sleep mode
Maybe !
VB Code:
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
MessageBox.Show(Hex(e.KeyValue).ToString)
End Sub
-
Apr 4th, 2004, 05:45 PM
#3
Thread Starter
Fanatic Member
Doesn't seem to work exactly pirate. It does display a hex code, but some of them do not match the ASCII table. For example, the ASCII table says that the " + " symbol is 2B and the code above says it is BB.
What do yo think?
-
Apr 4th, 2004, 06:16 PM
#4
try this in the keypress event ...
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
MessageBox.Show(Convert.ToInt32(e.KeyChar).ToString("X")) '/// specify X to convert to Hex
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Apr 4th, 2004, 06:22 PM
#5
for more info on the ToString method and what it can do ( apart from the standard tostring ) check this msdn article ... Enum.Format Method
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Apr 5th, 2004, 03:31 AM
#6
Thread Starter
Fanatic Member
Thanks for the info and the tip!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|