Input of unique characters

This forum is for general developer support questions.

Input of unique characters

Postby desler » Tue Mar 22, 2016 9:20 am

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
desler
 
Posts: 2
Joined: Tue Mar 15, 2016 11:18 pm

Re: Input of unique characters

Postby chris » Wed Mar 23, 2016 1:03 am

IDCMP_VANILLAKEY is useless for all but the simplest of cases. Try IDCMP_RAWKEY.
chris
 
Posts: 551
Joined: Sat Jun 18, 2011 12:05 pm

Re: Input of unique characters

Postby javierdlr » Wed Mar 23, 2016 1:09 am

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?
User avatar
javierdlr
Beta Tester
Beta Tester
 
Posts: 368
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain

Re: Input of unique characters

Postby desler » Wed Mar 23, 2016 11:36 pm

@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?
desler
 
Posts: 2
Joined: Tue Mar 15, 2016 11:18 pm

Re: Input of unique characters

Postby chris » Thu Mar 24, 2016 5:44 pm

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.
chris
 
Posts: 551
Joined: Sat Jun 18, 2011 12:05 pm


Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 1 guest