Input of unique characters

This forum is for general developer support questions.
Post Reply
desler
Posts: 2
Joined: Tue Mar 15, 2016 10:18 pm

Input of unique characters

Post by desler »

Hello everybody
I am having problems parsing unique keys in my program (for example greek letters or cyrillic letters). I am currently using IDCMP_VANILLAKEY to trap input from user, but either I am not parsing the output correctly, or else I need to do something else to get the correct character.
I would be very grateful, if any could point me to the correct path. If I should be so lucky that someone even had a code example, I would be almost ecstatic :) (C or C++).

Thanks you
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Input of unique characters

Post by chris »

IDCMP_VANILLAKEY is useless for all but the simplest of cases. Try IDCMP_RAWKEY.
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 10:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Input of unique characters

Post by javierdlr »

desler wrote:Hello everybody
I am having problems parsing unique keys in my program (for example greek letters or cyrillic letters). I am currently using IDCMP_VANILLAKEY to trap input from user, but either I am not parsing the output correctly, or else I need to do something else to get the correct character.
I would be very grateful, if any could point me to the correct path. If I should be so lucky that someone even had a code example, I would be almost ecstatic :) (C or C++).

Thanks you
Don't know if it what you' re looking for, but here is and example http://jabirulo.site90.com/temp/TestRawKey.c (not made by me)
Or are you using ReAction objects/classes?
desler
Posts: 2
Joined: Tue Mar 15, 2016 10:18 pm

Re: Input of unique characters

Post by desler »

@Jaiverdir
Thanks for the example. I definitely think this is the way to go. However, I am getting a guru the first time I call RawKeyConvert and then garbage from the char container. I know that I most likely am doing something wrong, but I just want to make sure that I don't have to take any special precautions when using C++ instead of C. Also are there any other cases anyone can think of that can cause the guru?
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Input of unique characters

Post by chris »

desler wrote:@Jaiverdir
Thanks for the example. I definitely think this is the way to go. However, I am getting a guru the first time I call RawKeyConvert and then garbage from the char container. I know that I most likely am doing something wrong, but I just want to make sure that I don't have to take any special precautions when using C++ instead of C. Also are there any other cases anyone can think of that can cause the guru?
Don't use RawKeyConvert - use MapRawKey().

I didn't know there was a RawKeyconvert, but it looks like it's part of console.device, so you would need to open that device and the interface. Anyway, use MapRawKey, the parameters are the same.
Post Reply