Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » getting unichar chars in C

Credits go to Edgar Reynaldo for helping out!
This thread is locked; no one can reply to it. rss feed Print
getting unichar chars in C
Bob Keane
Member #7,342
June 2006

I am trying to write a game in C and have a few questions. I need to get user input and found this thread doing something similar. However, it appears to be C++, is there an equivalent for C?

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
If we get apple juice from squeezing apples, and we get prunes from drying out plums, where does prune juice come from?
Hi Randall Monroe.

Edgar Reynaldo
Member #8,592
May 2007
avatar

Your link is broken.

Basically, you want to monitor ALLEGRO_EVENT_KEY_CHAR events. It will give you both the keycode and the unichar code. Do what you want with them. ;)

Bob Keane
Member #7,342
June 2006

I think I see it now. Thanks. Fixed the link.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
If we get apple juice from squeezing apples, and we get prunes from drying out plums, where does prune juice come from?
Hi Randall Monroe.

NiteHackr
Member #2,229
April 2002

I accept unicode characters in my own Deluxe Pacman games (see sourcecode at link in sig). You can check out my highscore input routines specifically which accept unicode. This is all written in C as well, no C++ in it.

--
Deluxe Pacman 1 & 2 (free) with source code available
https://nitehackr.github.io/games_index.html

Bob Keane
Member #7,342
June 2006

Thanks, I'll check it out.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
If we get apple juice from squeezing apples, and we get prunes from drying out plums, where does prune juice come from?
Hi Randall Monroe.

Go to: