Solved

How does KeyAscii behave under MBCS?

Posted on 2003-11-11
14
348 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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
 
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

822 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