Solved

How does KeyAscii behave under MBCS?

Posted on 2003-11-11
14
346 Views
Last Modified: 2008-03-06
I can't seem to find any online resources about this.  I'm doing Japanese localisation under VB6, and I want to know how the following code behaves when running under a Japanese locale:

Private Sub txtXxxx_KeyPress(Index As Integer, KeyAscii As Integer)
End Sub

Does the KeyAscii value come in as Unicode corresponding to the character pressed in the local language?  Or is it more complicated than that?

If it IS Unicode, what happens for values inthe range x8000-xFFFF?  Is there any problem with signed Integers?
0
Comment
Question by:mtorr
  • 4
  • 3
  • 3
  • +3
14 Comments
 
LVL 2

Expert Comment

by:diarmaid
ID: 9721627

You could create a small vb project and set a breakpoint inside the keypress event and examine the KeyAscii value...
0
 

Author Comment

by:mtorr
ID: 9721667
I could, if I had access to a Japanese keyboard and knew what the Unicode values were... however, I don't.  I was really looking for a more theoretical answer!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9721939
0
 

Author Comment

by:mtorr
ID: 9722255
Thanks - that was quite instructive about Unicode in general, but it didn't mention KeyAscii...
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9722850
0
 

Author Comment

by:mtorr
ID: 9729426
I need to know about KeyAscii, which is an argument to the TextBox control's KeyPress event.  I already know about the usual VB string functions.  Neither of your suggested links covers this.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9731401
OK. Good luck then.
0
 
LVL 2

Expert Comment

by:diarmaid
ID: 9731450
My only other (last ditch) suggestion would be to check the Unicode values at http://www.unicode.org/charts/
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9731490
To bad we don't have Japanese or chinese in our machine.

However since the
KeyAscii As Integer

I believe everything should be return as one

I guess
0
 

Author Comment

by:mtorr
ID: 9731605
Thanks for the link to the Unicode charts, diarmaid.  It has at least confirmed that Japanese characters seem to be in the range 3000-3FFF, so signed integers should not be a problem.

I still need to know how KeyAscii behaves with a Japanese OS/keyboard.  Somebody out there must know this, I'm sure!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10537176
mtorr, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

Dan Rollins -- EE database cleanup volunteer
0
 
LVL 2

Expert Comment

by:diarmaid
ID: 10539350
agreed
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 10577775
PAQed, with points refunded (250)

ee_ai_construct
Community Support Moderator
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now