From: David De Bono on
Hi!

In our application we need to read the unicode keypresses as we support
multiple languages.

The Form keypress event does not return unicode keycodes.

Is there any way of reading the last pressed key ? For example using API ?

Then we could put this code in the For Keypress event, and find the correct
unicode keycode.

We using this to output the correct unicode letters using 3rd party
controls.

David

From: Karl E. Peterson on
David De Bono submitted this idea :
> Hi!
>
> In our application we need to read the unicode keypresses as we support
> multiple languages.
>
> The Form keypress event does not return unicode keycodes.
>
> Is there any way of reading the last pressed key ? For example using API ?

I've just started fiddling around with the RawInput API. If you only
support XP+, that might be an option.

http://msdn.microsoft.com/en-us/library/ms645536(v=VS.85).aspx

So far, I've got the mouse stuff working pretty well, but haven't
fiddled with the keyboard yet. That said, I am *totally* unfamiliar
with any keyboards that offer Unicode keys. Where the heck might
someone find something like that?

Actually, now that I say that, I remember there's a ToUnicode function
that will take a virtual keycode and keyboard state, and translate that
to a Unicode character.

http://msdn.microsoft.com/en-us/library/ms646320%28VS.85%29.aspx

If RawInput is too overwhelming, you could probably test the keyboard
state whenever you get a KeyDown event?

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Bob Riemersma on
"Karl E. Peterson" <karl(a)exmvps.org> wrote in message
news:i277tr$t25$1(a)news.eternal-september.org...
> David De Bono submitted this idea :
>> Hi!
>>
>> In our application we need to read the unicode keypresses as we support
>> multiple languages.
>>
>> The Form keypress event does not return unicode keycodes.
>>
>> Is there any way of reading the last pressed key ? For example using API
>> ?
>
> I've just started fiddling around with the RawInput API. If you only
> support XP+, that might be an option.
>
> http://msdn.microsoft.com/en-us/library/ms645536(v=VS.85).aspx
>
> So far, I've got the mouse stuff working pretty well, but haven't fiddled
> with the keyboard yet. That said, I am *totally* unfamiliar with any
> keyboards that offer Unicode keys. Where the heck might someone find
> something like that?
>
> Actually, now that I say that, I remember there's a ToUnicode function
> that will take a virtual keycode and keyboard state, and translate that to
> a Unicode character.
>
> http://msdn.microsoft.com/en-us/library/ms646320%28VS.85%29.aspx
>
> If RawInput is too overwhelming, you could probably test the keyboard
> state whenever you get a KeyDown event?
>

I didn't think any keyboards do Unicode input as such. Don't they use
multi-key entry via one of the IMEs?

http://blogs.msdn.com/b/wit/archive/2009/01/14/introduction-to-east-asian-writing-systems-and-imes.aspx

From: Karl E. Peterson on
Bob Riemersma explained :
> "Karl E. Peterson" <karl(a)exmvps.org> wrote in message
> news:i277tr$t25$1(a)news.eternal-september.org...
>> David De Bono submitted this idea :
>>> Hi!
>>>
>>> In our application we need to read the unicode keypresses as we support
>>> multiple languages.
>>>
>>> The Form keypress event does not return unicode keycodes.
>>>
>>> Is there any way of reading the last pressed key ? For example using API ?
>>
>> I've just started fiddling around with the RawInput API. If you only
>> support XP+, that might be an option.
>>
>> http://msdn.microsoft.com/en-us/library/ms645536(v=VS.85).aspx
>>
>> So far, I've got the mouse stuff working pretty well, but haven't fiddled
>> with the keyboard yet. That said, I am *totally* unfamiliar with any
>> keyboards that offer Unicode keys. Where the heck might someone find
>> something like that?
>>
>> Actually, now that I say that, I remember there's a ToUnicode function that
>> will take a virtual keycode and keyboard state, and translate that to a
>> Unicode character.
>>
>> http://msdn.microsoft.com/en-us/library/ms646320%28VS.85%29.aspx
>>
>> If RawInput is too overwhelming, you could probably test the keyboard state
>> whenever you get a KeyDown event?
>>
>
> I didn't think any keyboards do Unicode input as such. Don't they use
> multi-key entry via one of the IMEs?
>
> http://blogs.msdn.com/b/wit/archive/2009/01/14/introduction-to-east-asian-writing-systems-and-imes.aspx

I honestly have no idea. I'm just another ignorant 'mercan on that
count. :-/

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Karl E. Peterson on
Karl E. Peterson explained :
> Bob Riemersma explained :
>> "Karl E. Peterson" <karl(a)exmvps.org> wrote in message
>> news:i277tr$t25$1(a)news.eternal-september.org...
>>> David De Bono submitted this idea :
>>>> Hi!
>>>>
>>>> In our application we need to read the unicode keypresses as we support
>>>> multiple languages.
>>>>
>>>> The Form keypress event does not return unicode keycodes.
>>>>
>>>> Is there any way of reading the last pressed key ? For example using API
>>>> ?
>>>
>>> I've just started fiddling around with the RawInput API. If you only
>>> support XP+, that might be an option.
>>>
>>> http://msdn.microsoft.com/en-us/library/ms645536(v=VS.85).aspx
>>>
>>> So far, I've got the mouse stuff working pretty well, but haven't fiddled
>>> with the keyboard yet. That said, I am *totally* unfamiliar with any
>>> keyboards that offer Unicode keys. Where the heck might someone find
>>> something like that?
>>>
>>> Actually, now that I say that, I remember there's a ToUnicode function
>>> that will take a virtual keycode and keyboard state, and translate that to
>>> a Unicode character.
>>>
>>> http://msdn.microsoft.com/en-us/library/ms646320%28VS.85%29.aspx
>>>
>>> If RawInput is too overwhelming, you could probably test the keyboard
>>> state whenever you get a KeyDown event?
>>>
>>
>> I didn't think any keyboards do Unicode input as such. Don't they use
>> multi-key entry via one of the IMEs?
>>
>> http://blogs.msdn.com/b/wit/archive/2009/01/14/introduction-to-east-asian-writing-systems-and-imes.aspx
>
> I honestly have no idea. I'm just another ignorant 'mercan on that count.
> :-/

But regardless, that ToUnicode function certainly implies their use can
be interpreted in that way, no?

--
..NET: It's About Trust!
http://vfred.mvps.org